View source: R/add_heartrate.R
add_hr | R Documentation |
add_hr()
imports an external file containing heart rate data and adds
it to an existing gas exchange data file.
add_hr(data, hr_file, hr_offset = 0)
data |
A |
hr_file |
The absolute or relative path of a |
hr_offset |
An integer, corresponding to the temporal offset of the heart-rate file. By default the start of the heart rate measurement is linked to the start of the gas exchange measurement. A positive value means, that the heart rate measurement started after the begin of the gas exchange measurements; a negative value means it started before. |
Heart rate data will be imported from a .tcx
file. After interpolating
the data to full seconds, it is then matched to the imported gas exchange
data.
A data.frame
of the class spiro
containing the
cardiopulmonary exercise testing data including heart rate data.
# Get example data
oxy_file <- spiro_example("zan_ramp")
hr_file <- spiro_example("hr_ramp.tcx")
# Import and process spiro data
oxy_data <- spiro(oxy_file)
# Add heart rate data
out <- add_hr(oxy_data, hr_file)
head(out)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.