respr v2.0 was a huge rewrite and rethinking of the
entire package. During this process it quickly became clear we could not
update the package satisfactorily without breaking some code from v1.x.
Therefore, we took the decision to implement these and a few other
improvements in the belief that it was better to do it now and have the
package work consistently and logically well into the future even if it
meant some v1.x code may break.
While the majority of the package workflows are in general unchanged,
and older code may work, there are enough changes that we
recommend old code be used very carefully with v2.
workflows are generally concise and overall work in the same way, so any
updating of code to be compatible should be relatively
This is an incomplete summary of the major code changes in v2.0, with some suggestions for how to update older code to allow it to work. See here for full release notes for this version.
If you have completed or are in the process of submitting a
respR v1.x code as supplementary
vignette("v1_code") for information about
how to include a link to
respR v1.1 so that your code will
remain reproducible in the future.
If you come across any changes that are not documented here, and you think should be, let us know and we will add it to the list.
As well as
pcrit being removed,
has been renamed
oxy_crit() to avoid conflicts with another
package. Any code using
calc_pcrit can be replaced with
oxy_crit, and may work, since the defaults have
remained largely the same. Note however the new
input. Previously both currently supported methods were performed, but
now only one is, selected using
method with Broken-Stick
regression the default. Therefore, outputs may not be the same. Output
objects have been completely restructured and elements renamed, so any
code extracting results from these will not work.
The entire workflow for analysing flowthrough respirometry data has
changed. Any previous code for analysing these types of data will likely
not work, and should be rewritten using the four new specialised
vignette("flowthrough") for more
Several function inputs have been renamed to make them more consistent.
All primary inputs are now
x (was previously
subsample among others). Any code specifically using
df = can be replaced with
x =, otherwise it
will not be affected.
Some functions have had inputs reordered
auto_rate now has
method as second
input). Therefore, code where inputs were not explicitly named may not
work as it did previously.
Some input defaults have been changed. E.g. in
oxy.unit = NULL and
time.unit = NULL now stop the function instead of applying
a default unit.
The majority of function outputs have been restructured and many
elements renamed. Any code that directly extracted results or parameters
from these may not now work. Updating code should be relatively
straightforward as error messages will state an element is missing or
not found, or a
NULLwill be returned. Normal
object-oriented workflows should not be affected as functions have been
updated to recognise new element names.
The general changes include the following:
Data element renamed
$dataframe instead of
Output rate elements have consistent naming structure starting
rate, with a suffix where relevant:
$output changed to
$bgrate changed to
$corrected changed to
Outputs have also been rearranged, so any referencing not using
element names may not work the same
Summary tables (
$summary) now have a
rank column in position 1, and have also in general been
rearranged, new columns added, and some columns renamed. Therefore if
column numbers or names have been used to extract results these may now
This function has been rewritten to be less aggressive about removing empty or non-numeric columns, or those containing data which wasn’t time or oxygen, such as temperature. Now, all columns are retained, where possible. Column renaming has been updated to be much more robust, ensuring unique column names, and removing problematic characters. The result is any previous datasets imported using this function will likely have different column structures and naming. Best option is to reimport the data, check the structure, and edit any column references in subsequent code.
If saving output as a data frame, the added numeric time column is
time.num rather than
$elapsed is used in code for some reason,
find and replace
df now renamed to
x. Any code
df = can be replaced with
Inputs have been reordered with
method as second input.
Code where inputs were not explicitly named may not work as it did
"min" methods have been
deprecated. These still work as before for now, so older code using
these will still work, but they will be removed in a future version.
Most users should use
instead. Note the new
methods do not work the same as
"max"/"min", as they order strictly numerically. See
width input behaviour has changed slightly.
Previously if it was a value between 0 and 1 it represented a
proportional width of the whole dataset regardless of the
by input. This now applies only to
by = "row".
by = "time" any value between 0 and 1 now represents (as
with values above 1) a time window in the units of the time data. Any
by = "time" and
width between 0 and
1 will now produce different outputs. Replace
by = "time"
by = "row" and the results should match the previous
By default, the function now outputs a vector of converted numeric
values as opposed to the previous output which was a
object of class
convert_DO. A new
logical input controls this, with the default being
Previous code which saved this output for later use can restore this
behaviour by adding
simplify = FALSE to the call. Code
which used or extracted converted values by calling the
$output element can be used by doing a search for this and
replacing it with nothing, or deleting it.
"%" oxygen unit has been deprecated and replaced
"%Air". In older code replace
other variations such as
help("convert_DO"). Note, the
additional unit of
"%Oxy" has been added. These are not the
This function has been completely rewritten to incorporate several
new adjustment methods. The original inputs (
by) have been retained as the first two inputs, and the
default behaviour of applying the mean of all background rates in
by as the adjustment value is also retained. Therefore,
older code should work as before, but care should be taken that
the desired adjustments are applied as expected.
A change to the code for determining
by = "oxygen"
ranges to ensure it works with both oxygen production data as well as
oxygen uptake data, means that output results may differ from those in
v1.1. The previous behaviour was the function found the first occurrence
from value, then the first occurrence of
to, with rates determined between these bounds. Now, it
finds the first occurrence of
from, then the last
to. With most data any difference in rates as
a result of this change should be minor. Also as a result, data subsets
subset_data() using this method now tend to be
$locs_raw. Code should not
need to be updated unless these were used to extract references to fix
data issues in the relevant data frames.