Learn R Programming

respR : Processing and analysis of respirometry data

respR is a package for R that provides a structural, reproducible workflow for the processing and analysis of respirometry data. While the focus of the package is on aquatic respirometry, respR is largely unitless and so can process, explore, and determine rates from any respirometry data, and indeed linear relationships in any time-series data.

Use respR to:

  • Inspect respirometry data for common issues before analysis
  • Explore and visualise oxygen timeseries
  • Calculate rates manually or automatically using multiple regression analysis
  • Adjust rates for background oxygen consumption or production
  • Convert rates to any common unit of oxygen consumption or production
  • Select rates according to various criteria
  • Export results quickly for reporting
  • Identify critical oxygen values, such as $P_{crit}$

A highlight of the package is the auto_rate() function. This uses machine learning (kernel density estimation) to automatically identify linear regions of data, that is regions where oxygen uptake or production rates are stable and consistent. This allows metabolic rates to be extracted in an objective manner. See vignette("auto_rate") for more details.

Installation

respR is now available on CRAN, and can be installed via the 'Packages' tab in RStudio or by running this command:

install.packages("respR")

You can also install the latest version direct from Github:

devtools::install_github("januarharianto/respR")

Getting started

Visit the respR website to get started. The site has a range of vignettes detailing the functionality, plus example workflows, documentation, and more.

We are also happy to help directly. If you have problems using the package or getting started with your analysis, get in touch with a sample of your data and we will help get you started.

Publication

The package has also been peer reviewed and published in Methods in Ecology and Evolution. Please cite this publication if you use respR in your published work.

respR has been used to examine metabolic rates and photosynthesis in corals, plankton, micro- and macro-algae, fish, crustaceans, echinoderms, cephalopods, bivalves and more, in both lab and field studies. Check the respR Citations page to see a list of published studies which have used the package to analyse their data.

 
 
 

Contact, feedback and help

See here for more ways of providing feedback and getting in touch if you are having issues.

For the latest news and regular updates from the world of respirometry follow respR on Mastodon.

Support package development

If you would like to help support the package development or just buy us a beer to say thanks see here

Developers

Usage

For a quick evaluation of the package, try out the following code:

library(respR) # load the package

# 1. Check data for errors, selecting cols 1 and 15:
urch <- inspect(urchins.rd, time = 1, oxygen = 15) 
# 2. Automatically determine most linear regions:
rate <- auto_rate(urch)
# 3. Convert
out <- convert_rate(rate, 
                    oxy.unit = "mg/L", 
                    time.unit = "min", 
                    output.unit = "mg/h/kg", 
                    volume = 0.6, 
                    mass = 0.4)
print(out)

## Alternatively, use pipes:
urchins.rd %>%        # using the urchins dataset,
  select(1, 15) %>%   # select columns 1 and 15
  inspect()     %>%   # inspect the data, then
  auto_rate()   %>%   # automatically determine most linear segment
  print()       %>%   # a quick preview
  convert_rate("mg/L", "min", "mg/h/kg", 0.6, 0.4) # convert to units

Copy Link

Version

Install

install.packages('respR')

Monthly Downloads

356

Version

2.3.3

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Nicholas Carey

Last Published

May 10th, 2024

Functions in respR (2.3.3)

algae.rd

Oxygen production respirometry data
adjust_rate

Adjust rates to account for background respiration or oxygen flux.
adjust_rate.ft

Adjust rates in flowthrough respirometry to account for background respiration or oxygen flux.
adjust_scale_area

Convert between multipliers of the same AREA unit, e.g. mm2 to km2
auto_rate.rep

Function for auto_rate with replicate number in summary plus limit to n results
adjust_scale

Convert between multipliers of the same unit, e.g. mg to kg
auto_rate.int

Run auto_rate on multiple replicates in intermittent-flow respirometry data
auto_rate

Automatically determine most linear, highest, lowest and rolling oxygen uptake or production rates
StP.check

Checks if an oxygen concentration/pressure unit or metabolic rate unit requires temperature, salinity, and pressure to convert to another unit.
StP.val

Returns an error message if an oxygen concentration/pressure unit or metabolic rate unit requires S or t and either is NULL, or a message if it requires P and it is NULL.
auto_rate_min

Perform rolling regression and rank from NUMERICAL minimum to maximum i.e. includes sign - most negative rates are highest
background_con.rd

Background respirometry data (constant)
auto_rate_highest

Perform rolling regression and rank from ABSOLUTE highest to lowest
auto_rate_interval

Obtain rate values at non-overlapping intervals of a dataset
auto_rate_lowest

Perform rolling regression and rank from ABSOLUTE lowest to highest
auto_rate_linear

Linear detection method
auto_rate_rolling

Perform rolling regression of fixed width and do not reorder results
auto_rate_max

Perform rolling regression and rank from NUMERICAL maximum to minimum i.e. includes sign - most positive rates are highest
background_lin.rd

Background respirometry data (linear)
background_exp.rd

Background respirometry data (exponential)
class.val

Validates acceptable classes of inputs Set single or multiple inputs to TRUE. This is what the fn accepts. If x is any one of these a single TRUE will be returned
calc_win

Automatically calculate rolling window
calc_rate.int

Extract rates from multiple replicates in intermittent-flow respirometry data
convert_MR

Convert between units of absolute, mass-specific, or area-specific metabolic rates
convert_DO

Convert between units of dissolved oxygen
calc_rate.rep

Function for calc_rate with replicate number in summary
broken_stick

Perform broken-stick regressions
calc_rate

Calculate rate of change in oxygen over time
calc_rate.ft

Calculate rate of change in oxygen from flowthrough respirometry data
flowthrough.rd

Flowthrough respirometry data on the chiton, Mopalia lignosa
calc_rate.bg

Calculate background oxygen uptake or input rates
convert_rate

Convert a unitless oxygen rate value to absolute, mass-specific or area-specific rate
convert_rate.ft

Convert a unitless oxygen rate value from flowthrough respirometry to absolute, mass-specific or area-specific rates
flow_unit_parse

Extracts time and volume units from flowrate unit already parsed by units.val
convert_MR_print

Print results of convert_MR
flowthrough_mult.rd

Multi-column flowthrough respirometry data
convert_val

Convert values of temperature, volume, mass, area, and atmospheric pressure to different units
format_time

Parse date-time data to numeric time for use in respR functions
flowthrough_sim.rd

Flowthrough respirometry data with increasing background rate
extract_indices

Extract row, time and DO indices from a subset dataframe
mean.adjust_rate

Average adjust_rate object rates
inspect

Explore and visualise respirometry data and check for common errors
import_file

Import respirometry system raw data files (DEPRECATED)
%>%

Pipe graphics direct from tidyverse-related package
kernel_method

Kernel density function
generate_mrdf

Generate a DO ~ PO2 data table from a DO timeseries
intermittent.rd

Respirometry data of the sea urchin, Heliocidaris Erythrogramma
linear_fit

Perform a linear regression on a data frame
mean.auto_rate.int

Average auto_rate.int object rates
mean.calc_rate.int

Average calc_rate.int object rates
mean.convert_rate

Average convert_rate object rates
get_dec

Identify decimal character For European formatted files with commas as decimal separator
mean.calc_rate

Average calc_rate object rates
mean.convert_DO

Average convert_DO object values
mean.inspect

Average inspect object rates
overlap.ft.p

Plot convert_rate.ft summary tables
overlap.p

Plot convert_rate and auto_rate summary tables
mean.calc_rate.bg

Average calc_rate.bg object rates
mean.calc_rate.ft

Average calc_rate.ft object rates
midpt

Get midpoint between two values or within a vector For getting midpoint timestamps from Time data
nainf.omit

Omit NA, NaN, Inf and -Inf from a vector or dataframe columns
plot.convert_rate.ft

Plot convert_rate.ft objects
mean.oxy_crit

Average oxy_crit object rates
plot.adjust_rate.ft

Plot adjust_rate.ft objects
plot.convert_rate

Plot convert_rate objects
mean.convert_rate.ft

Average convert_rate.ft object rates
plot.calc_rate.ft

Plot calc_rate.ft objects
plot.auto_rate

Plot auto_rate objects
plot.calc_rate.bg

Plot calc_rate.bg objects
print.auto_rate

Print auto_rate objects
method.val

Validate adjust_rate or auto_rate or oxy_crit method input
print.auto_rate.int

Print auto_rate.int objects
plot.oxy_crit

Plot oxy_crit objects
plot.test_lin

Plot output of test_lin
print.convert_rate.ft

Print convert_rate.ft objects
print.calc_rate

Print calc_rate objects
print.calc_rate.bg

Print calc_rate.bg objects
inspect.ft

Explore and visualise flowthrough respirometry data and check for errors
mean.adjust_rate.ft

Average adjust_rate.ft rates
print.inspect.ft

Print inspect.ft objects
print.oxy_crit

Print oxy_crit objects
print.inspect

Print inspect objects
oxy_crit

Calculate critical oxygen values, such as PCrit
print.adjust_rate

Print adjust_rate objects
plot.calc_rate.int

Plot calc_rate.int objects
plot.auto_rate.int

Plot auto_rate.int objects
print.adjust_rate.ft

Print adjust_rate.ft objects
plot.adjust_rate

Plot adjust_rate objects
mean.inspect.ft

Average inspect.ft object rates
plot.calc_rate

Plot calc_rate objects
subset_data

Subset a data.frame, inspect, or inspect.ft object
summary.adjust_rate

Summarise adjust_rate objects
summary.calc_rate

Summarise calc_rate objects
print.calc_rate.ft

Print calc_rate.ft objects
mean.auto_rate

Average auto_rate object rates
summary.auto_rate.int

Summarise auto_rate.int objects
plot.convert_DO

Plot convert_DO objects
plot.inspect

Plot inspect objects
plot.inspect.ft

Plot inspect.ft objects
sim_data

Randomly generate data for internal testing of auto_rate()'s linear method.
squid.rd

Respirometry data of the squid, Doryteuthis opalescens
print_dens

Prints the density object for summary.auto_rate S3 Basically copied from stats:::print.density and edited to make it more compact
static_roll

Normal rolling regression
subsample

Subsample a data frame object
rolling_reg_row

Perform regular rolling regression
print.convert_rate

Print convert_rate objects
sardine.rd

Respirometry data of the sardine, Sardinops sagax
summary.oxy_crit

Summarise oxy_crit objects
select

Select columns
test_lin

Perform auto_rate() iteratively and extract performance metrics
summary.convert_rate

Summarise convert_rate objects
select_rate

Select rate results based on a range of criteria
unit_type_o1

Search for and classify oxygen units as used in concentration or rates
rolling_reg_time

Perform rolling regression based on time units.
units.clean

Cleans units from units.val to remove the suffix (.o2, .flow, etc)
print.convert_DO

Print convert_DO objects
print.calc_rate.int

Print calc_rate.int objects
validate_auto_rate

Validation function for auto_rate
zeb_intermittent.rd

Respirometry data of a zebrafish, Danio rerio
summary.adjust_rate.ft

Summarise adjust_rate.ft objects
summary.auto_rate

Summarise auto_rate objects
unit_args

Print examples of unit inputs
summary.calc_rate.ft

Summarise calc_rate.ft objects
time_roll

Perform time-width rolling regression
summary.inspect

Summarise inspect objects
summary.calc_rate.bg

Summarise calc_rate.bg objects
summary.convert_DO

Summarise convert_DO objects
summary.convert_rate.ft

Summarise convert_rate.ft objects
summary.inspect.ft

Summarise inspect.ft objects
time_lm

Subset data by time and perform a linear regression.
summary.calc_rate.int

Summarise calc_rate.int objects
urchins.rd

Multi-column respirometry data of the sea urchin, Heliocidaris Erythrogramma, including background respiration
units.val

Check unit string against allowed values. See util_fns.R file for regex patterns
unit_type

Search for and classify units