Skip to contents

spiro_summary() returns a data.frame summarizing the main parameters for each step of a cardiopulmonary exercise test.

Usage

spiro_summary(data, interval = 120, quiet = FALSE, exclude = FALSE)

Arguments

data

A data.frame of the class spiro, as it is generated by spiro.

interval

An integer giving the length of the computational interval in seconds.

quiet

A logical value, whether or not messages should be displayed, for example when intervals are shortened for specific steps.

exclude

A logical value, whether the last step should be excluded from the summary if it was not completely performed.

Value

A data.frame with the mean parameters for each step of the exercise protocol.

Details

This function generates mean values of gas exchange and cardiac parameters for all steps of an exercise test. The calculation returns the mean of a given interval before the end of each step.

If the interval exceeds the duration of any step, a message will be displayed. If the interval exceeds the duration of all steps, it will be reset to the duration of the longest step. You can silence all messages by setting quiet = TRUE.

When setting exclude = TRUE the function will check whether the last load step was terminated early. If this was the case, the step will not be displayed in the summary.

Examples

# Import and process example data
gxt_data <- spiro(file = spiro_example("zan_gxt"))

spiro_summary(gxt_data)
#> for pre-measures, interval was set to length of measures (60 seconds)
#>    step_number duration load     VO2    VCO2     VE HR PetO2 PetCO2 VO2_rel
#> 1            0       60  0.0  500.19  411.74  13.03 NA    NA     NA    7.58
#> 2            1      300  2.0 1860.92 1585.75  39.87 NA    NA     NA   28.20
#> 3            2      300  2.4 2097.82 1805.27  44.63 NA    NA     NA   31.79
#> 4            3      300  2.8 2413.01 2122.17  52.63 NA    NA     NA   36.56
#> 5            4      300  3.2 2710.68 2319.93  57.19 NA    NA     NA   41.07
#> 6            5      300  3.6 3048.75 2684.87  67.45 NA    NA     NA   46.19
#> 7            6      300  4.0 3404.02 3026.70  75.91 NA    NA     NA   51.58
#> 8            7      300  4.4 3724.37 3383.64  88.36 NA    NA     NA   56.43
#> 9            8      300  4.8 4223.82 3993.55 106.44 NA    NA     NA   64.00
#> 10           9      300  5.2 4573.91 4488.36 127.54 NA    NA     NA   69.30
#>        RE  RER  CHO   FO
#> 1      NA 0.82 0.27 0.15
#> 2  234.97 0.85 1.27 0.46
#> 3  220.73 0.86 1.51 0.49
#> 4  217.62 0.88 1.95 0.48
#> 5  213.91 0.86 1.89 0.65
#> 6  213.86 0.88 2.47 0.60
#> 7  214.90 0.89 2.90 0.62
#> 8  213.75 0.91 3.50 0.56
#> 9  222.21 0.95 4.68 0.37
#> 10 222.12 0.98 5.82 0.12