README.md

respfun

Travis build
status AppVeyor build
status Coverage
status DOI

The respfun package is a collection of functions for use with respirometry data and experiments. I will add to it periodically (suggestions welcome). It is not intended to be a fully featured package, more a collection of handy functions.

If you use it a citation using this Zenodo DOI would be much appreciated.

For full analyses of your respirometry data check out another package I co-developed: respR.

Installation

respfun can be installed using the devtools package:

install.packages("devtools")
devtools::install_github("nicholascarey/respfun")

Functions

Currently there are seven functions:

split_rate

This function divides a metabolic rate between a group of individuals based on their masses and a metabolic scaling exponent. It was used in this recent publication:

Benjamin P. Burford, Nicholas Carey, William F. Gilly, Jeremy A. Goldbogen. 2019. Grouping reduces the metabolic demand of a social squid. Marine Ecology Progress Series. 612: 141–150 https://doi.org/10.3354/meps12880

Rates can be entered manually, and it also integrates with the respR package: objects saved from the respR::convert_rate function can be entered (or %>% piped), and the rate and units will be automatically extracted.

## Simple example

split_rate(tR = 500,                  # total metabolic rate of group
           masses = c(2, 3, 4, 5, 6), # body masses
           b = 0.75,                  # metabolic scaling exponent
           units = "mg/h")            # units (optional)
#> 
#> # split_rate # -------------------------
#> Rate Division Complete: 
#> 
#> Total Group Rate(s) ($tR, entered):           
#> [1] 500
#> 
#> Metabolic Scaling Exponent ($b, entered):  
#> [1] 0.75
#> 
#> Masses ($masses, entered): 
#> [1] 2 3 4 5 6
#> 
#> Intercept(s) ($a, calculated) :               
#> [1] 35.79844
#> 
#> Individual rates ($indiv.rates, calculated): 
#> [[1]]
#> [1]  60.20557  81.60281 101.25329 119.69931 137.23902
#> 
#> Rate units: mg/h
## respR example

library(respR)                                           # Load respR

urchins.rd %>%                                           # NOT a group respirometry experiment,
                                                          # - Just using it as an example,
  inspect(1, 15) %>%                                     # inspect
  calc_rate(from = 4, to = 29, by = "time") %>%          # calculate rate
  print() %>%
  convert_rate(o2.unit = "mgl-1", time.unit = "m",       # convert
               output.unit = "mg/h", volume = 1.09) %>%
  split_rate(c(2, 3, 4, 5, 6, 7, 8),                     # divide
             0.75) %>%
  print()
#> 
#> # calc_rate # -------------------
#> Rate(s):
#> [1] -0.02177588
#> 
#> # convert_rate # ------------------------
#> Rank/position 1 result shown. To see all results use summary().
#> Input:
#> [1] -0.02177588
#> [1] "mg/L" "min" 
#> Converted:
#> [1] -1.424143
#> [1] "mg/hour"
#> 
#> # split_rate # -------------------------
#> Rate Division Complete: 
#> --- respR::convert_rate object detected ---
#> 
#> Total Group Rate(s) ($tR, entered via convert_rate input):
#> [1] -1.424143
#> 
#> Metabolic Scaling Exponent ($b, entered):  
#> [1] 0.75
#> 
#> Masses ($masses, entered): 
#> [1] 2 3 4 5 6 7 8
#> 
#> Intercept(s) ($a, calculated) :               
#> [1] -0.06184548
#> 
#> Individual rates ($indiv.rates, calculated): 
#> [[1]]
#> [1] -0.1040113 -0.1409772 -0.1749254 -0.2067928 -0.2370945 -0.2661531 -0.2941883
#> 
#> Rate units: mg/hour

See split_rate for more.

eff_vol

This calculates the ‘effective volume’ of a respirometer, that is the volume minus the volume of the specimen. This allows you to input the correct water volume into respirometry analyses in order to calculate the correct amount of oxygen used, for example in the respR::convert_rate function.

The respirometer volume (resp_vol) can be corrected to get the effective volume in a number of ways:

See eff_vol for more.

spec_density

This function calculates a specimen density from a total wet mass and a bouyant mass (see here). This is common in studies of shell bearing species such as molluscs and echinoderms where it is a non-lethal way of examining the ratio of shell to tissue mass. It can also be used to determine the animal volume for correcting respirometry water volumes (see above). The water temperature and salinity at which buoyant mass was determined are required. See spec_density for more.

wm_to_vol

This is a simple function to convert a water mass to a water volume. Sometimes it is easier to weigh a respirometer to determine the water mass than try to measure the volume, for example across large size ranges of specimen and respirometer size (e.g. Carey et al. 2016), where systematic error is a concern. The water temperature and salinity are required. See wm_to_vol for more.

scale_rate

This function scales a physiological rate to a different body mass using a scaling exponent. Works with both absolute (i.e. whole animal) and mass-specific rates. This function integrates with the respR package: objects saved from the respR::convert_rate function can be entered (or %>% piped), and the rate will be automatically extracted. See scale_rate for more.

q_ten

Calculates any of the five parameters in the Q10 temperature relationship for physiological or chemical processes. Q10 describes the ratio by which a physiological or chemical rate changes with a 10°C increase in temperature. Essentially the same as the Q10 function in the respirometry package by Matthew Birk, although that has additional functionality for determining the best fit Q10 for a range of rates/temperatures. See q_ten for more.

flush_time

Calculates the time taken to flush a respirometer with new water. It requires the volume of the respirometer (in L) and the flow rate (in L/s) of the input of new water. See flush_time for more.

Future functionality

In due course I’ll add a few more functions I find useful in working with respirometry and metabolic rate data. Suggestions for additional functions are welcome via email, or by opening an issue.

Bug reports

If you find any bugs, weird behaviour, or other issues please let me know or open an issue.



nicholascarey/respfun documentation built on June 15, 2025, 11:46 a.m.