-
-
Notifications
You must be signed in to change notification settings - Fork 4
/
README.Rmd
152 lines (116 loc) Β· 4.39 KB
/
README.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
---
output: github_document
---
<!-- README.md is generated from README.Rmd. Please edit that file -->
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```
# whippr <img src='man/figures/logo.png' align="right" height="240" />
<!-- badges: start -->
[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)
[![CRAN status](https://www.r-pkg.org/badges/version/whippr)](https://CRAN.R-project.org/package=whippr)
[![Codecov test coverage](https://codecov.io/gh/fmmattioni/whippr/branch/master/graph/badge.svg)](https://app.codecov.io/gh/fmmattioni/whippr?branch=master)
[![R-CMD-check](https://github.com/fmmattioni/whippr/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/fmmattioni/whippr/actions/workflows/R-CMD-check.yaml)
<!-- badges: end -->
The goal of `whippr` is to provide a set of tools for manipulating gas exchange data from cardiopulmonary exercise testing.
## Why `whippr`?
The name of the package is in honor of [Prof. Brian J Whipp](https://erj.ersjournals.com/content/39/1/1) and his invaluable contribution to the field of exercise physiology.
## Installation
You can install the development version of `whippr` from [Github](https://github.com/fmmattioni/whippr) with:
``` r
# install.packages("remotes")
remotes::install_github("fmmattioni/whippr")
```
## Use
### Read data
```{r}
library(whippr)
## example file that comes with the package for demonstration purposes
path_example <- system.file("example_cosmed.xlsx", package = "whippr")
df <- read_data(path = path_example, metabolic_cart = "cosmed")
df
```
### Interpolate
```{r}
df %>%
interpolate()
```
### Perform averages
#### Bin-average
```{r}
## example of performing 30-s bin-averages
df %>%
interpolate() %>%
perform_average(type = "bin", bins = 30)
```
#### Rolling-average
```{r}
## example of performing 30-s rolling-averages
df %>%
interpolate() %>%
perform_average(type = "rolling", rolling_window = 30)
```
### Perform VO<sub>2</sub> kinetics analysis
```{r}
results_kinetics <- vo2_kinetics(
.data = df,
intensity_domain = "moderate",
vo2_column = "VO2",
protocol_n_transitions = 3,
protocol_baseline_length = 360,
protocol_transition_length = 360,
cleaning_level = 0.95,
cleaning_baseline_fit = c("linear", "exponential", "exponential"),
fit_level = 0.95,
fit_bin_average = 5,
fit_phase_1_length = 20,
fit_baseline_length = 120,
fit_transition_length = 240,
verbose = TRUE
)
```
### Perform VO<sub>2max</sub> analysis
```{r}
df_incremental <- read_data(path = system.file("ramp_cosmed.xlsx", package = "whippr"), metabolic_cart = "cosmed")
vo2_max(
.data = df_incremental, ## data from `read_data()`
vo2_column = "VO2",
vo2_relative_column = "VO2/Kg",
heart_rate_column = "HR",
rer_column = "R",
detect_outliers = TRUE,
average_method = "bin",
average_length = 30,
plot = TRUE,
verbose = TRUE,
## arguments for `incremental_normalize()`
incremental_type = "ramp",
has_baseline = TRUE,
baseline_length = 240, ## 4-min baseline
work_rate_magic = TRUE, ## produce a work rate column
baseline_intensity = 20, ## baseline was performed at 20 W
ramp_increase = 25, ## 25 W/min ramp
## arguments for `detect_outliers()`
test_type = "incremental",
cleaning_level = 0.95,
method_incremental = "linear"
)
```
## Metabolic carts currently supported
* [COSMED](https://www.cosmed.com/en/)
* [CORTEX](https://cortex-medical.com/EN)
* [NSpire](https://www.pressebox.de/pressemitteilung/nspire-health-gmbh/ZAN-100-Diagnostische-Spirometrie/boxid/745555)
* Parvo Medics
* [Geratherm Respiratory](https://www.geratherm-respiratory.com/product-groups/cpet/)
* [CardioCoach](https://korr.com/go/cardiocoach/)
## Online app
Would you like to perform VO<sub>2</sub> kinetics analyses but don't know R? No problem! You can use our online app: [VO2 Kinetics App](https://exphyslab.com/kinetics/)
## Code of Conduct
Please note that this project is released with a [Contributor Code of Conduct](https://www.contributor-covenant.org/version/1/0/0/code-of-conduct.html).
By participating in this project you agree to abide by its terms.
<div>Icons made by <a href="https://www.flaticon.com/authors/monkik" title="monkik">monkik</a> from <a href="https://www.flaticon.com/" title="Flaticon">www.flaticon.com</a></div>