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.

 
 
 

Contact, feedback and help

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

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

1,362

Version

2.3.4

License

GPL-3

Issues

Pull Requests

Stars

Forks

Maintainer

Nicholas Carey

Last Published

October 10th, 2025

Functions in respR (2.3.4)

auto_rate_min

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

Background respirometry data (exponential)
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
auto_rate_lowest

Perform rolling regression and rank from ABSOLUTE lowest to highest
auto_rate_linear

Linear detection method
convert_DO

Convert between units of dissolved oxygen
background_lin.rd

Background respirometry data (linear)
background_con.rd

Background respirometry data (constant)
calc_rate

Calculate rate of change in oxygen over time
calc_rate.bg

Calculate background oxygen uptake or input rates
convert_MR

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

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

Perform rolling regression and rank from ABSOLUTE highest to lowest
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_rate.int

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

Print results of convert_MR
flow_unit_parse

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

Automatically calculate rolling window
convert_val

Convert values of temperature, volume, mass, area, and atmospheric pressure to different units
convert_rate.ft

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

Calculate rate of change in oxygen from flowthrough respirometry data
broken_stick

Perform broken-stick regressions
convert_rate

Convert a unitless oxygen rate value to absolute, mass-specific or area-specific rate
format_time

Parse date-time data to numeric time for use in respR functions
get_dec

Identify decimal character For European formatted files with commas as decimal separator
generate_mrdf

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

Flowthrough respirometry data with increasing background rate
inspect

Explore and visualise respirometry data and check for common errors
inspect.ft

Explore and visualise flowthrough respirometry data and check for errors
mean.auto_rate.int

Average auto_rate.int object rates
mean.auto_rate

Average auto_rate object rates
mean.adjust_rate.ft

Average adjust_rate.ft rates
mean.calc_rate.int

Average calc_rate.int object rates
calc_rate.rep

Function for calc_rate with replicate number in summary
flowthrough.rd

Flowthrough respirometry data on the chiton, Mopalia lignosa
extract_indices

Extract row, time and DO indices from a subset dataframe
flowthrough_mult.rd

Multi-column flowthrough respirometry data
import_file

Import respirometry system raw data files (DEPRECATED)
kernel_method

Kernel density function
oxy_crit

Calculate critical oxygen values, such as PCrit
mean.calc_rate

Average calc_rate object rates
intermittent.rd

Respirometry data of the sea urchin, Heliocidaris Erythrogramma
linear_fit

Perform a linear regression on a data frame
plot.convert_rate

Plot convert_rate objects
mean.inspect

Average inspect object rates
plot.adjust_rate

Plot adjust_rate objects
plot.test_lin

Plot output of test_lin
plot.inspect

Plot inspect objects
mean.oxy_crit

Average oxy_crit object rates
plot.convert_rate.ft

Plot convert_rate.ft objects
nainf.omit

Omit NA, NaN, Inf and -Inf from a vector or dataframe columns
mean.convert_DO

Average convert_DO object values
plot.auto_rate

Plot auto_rate objects
plot.convert_DO

Plot convert_DO objects
mean.adjust_rate

Average adjust_rate object rates
plot.oxy_crit

Plot oxy_crit objects
plot.auto_rate.int

Plot auto_rate.int objects
method.val

Validate adjust_rate or auto_rate or oxy_crit method input
sardine.rd

Respirometry data of the sardine, Sardinops sagax
plot.adjust_rate.ft

Plot adjust_rate.ft objects
plot.inspect.ft

Plot inspect.ft objects
mean.convert_rate

Average convert_rate object rates
print.inspect.ft

Print inspect.ft objects
print.convert_rate.ft

Print convert_rate.ft objects
print.calc_rate.ft

Print calc_rate.ft objects
overlap.p

Plot convert_rate and auto_rate summary tables
select_rate

Select rate results based on a range of criteria
subsample

Subsample a data frame object
print.auto_rate.int

Print auto_rate.int objects
mean.convert_rate.ft

Average convert_rate.ft object rates
print.calc_rate.int

Print calc_rate.int objects
plot.calc_rate.int

Plot calc_rate.int objects
plot.calc_rate

Plot calc_rate objects
print.oxy_crit

Print oxy_crit objects
%>%

Pipe graphics direct from tidyverse-related package
print_dens

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

Summarise convert_rate.ft objects
static_roll

Normal rolling regression
mean.calc_rate.bg

Average calc_rate.bg object rates
mean.calc_rate.ft

Average calc_rate.ft object rates
summary.auto_rate.int

Summarise auto_rate.int objects
rolling_reg_row

Perform regular rolling regression
plot.calc_rate.bg

Plot calc_rate.bg objects
overlap.ft.p

Plot convert_rate.ft summary tables
print.inspect

Print inspect objects
summary.calc_rate.bg

Summarise calc_rate.bg objects
summary.convert_rate

Summarise convert_rate objects
print.convert_DO

Print convert_DO objects
summary.inspect

Summarise inspect objects
select

Select columns
plot.calc_rate.ft

Plot calc_rate.ft objects
mean.inspect.ft

Average inspect.ft object rates
unit_args

Print examples of unit inputs
subset_data

Subset a data.frame, inspect, or inspect.ft object
rolling_reg_time

Perform rolling regression based on time units.
summary.convert_DO

Summarise convert_DO objects
summary.adjust_rate.ft

Summarise adjust_rate.ft objects
print.adjust_rate

Print adjust_rate objects
print.calc_rate

Print calc_rate objects
squid.rd

Respirometry data of the squid, Doryteuthis opalescens
summary.inspect.ft

Summarise inspect.ft objects
summary.auto_rate

Summarise auto_rate objects
summary.adjust_rate

Summarise adjust_rate objects
midpt

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

Summarise calc_rate objects
unit_type

Search for and classify units
time_roll

Perform time-width rolling regression
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
summary.oxy_crit

Summarise oxy_crit objects
zeb_intermittent.rd

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

Print adjust_rate.ft objects
units.clean

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

Print calc_rate.bg objects
time_lm

Subset data by time and perform a linear regression.
print.convert_rate

Print convert_rate objects
unit_type_o1

Search for and classify oxygen units as used in concentration or rates
summary.calc_rate.int

Summarise calc_rate.int objects
test_lin

Perform auto_rate() iteratively and extract performance metrics
print.auto_rate

Print auto_rate objects
validate_auto_rate

Validation function for auto_rate
summary.calc_rate.ft

Summarise calc_rate.ft objects
sim_data

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

Convert between multipliers of the same AREA unit, e.g. mm2 to km2
StP.check

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

Oxygen production respirometry data
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.
adjust_scale

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

Automatically determine most linear, highest, lowest and rolling oxygen uptake or production rates
auto_rate.rep

Function for auto_rate with replicate number in summary plus limit to n results
adjust_rate.ft

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

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

Adjust rates to account for background respiration or oxygen flux.