set_protocol_manual: Manually setting a testing profile

View source: R/add_protocol.R

set_protocol_manualR Documentation

Manually setting a testing profile

Description

set_protocol_manual() allows to set any user-defined load profile for an exercise test.

Usage

set_protocol_manual(duration, load = NULL)

## Default S3 method:
set_protocol_manual(duration, load)

## S3 method for class 'data.frame'
set_protocol_manual(duration, load = NULL)

Arguments

duration

Either a numeric vector containing the duration (in seconds) of each load step, or a data.frame containing columns for duration and load.

load

A numeric vector of the same length as duration containing the corresponding load of each step. Not needed, if load and duration are both given in a data.frame as the first argument of the function.

Value

A data.frame with the duration and load of each protocol step.

Methods (by class)

  • set_protocol_manual(default): Default method when duration and load are given separately

  • set_protocol_manual(data.frame): Method for data frames with a duration and a load column

See Also

set_protocol for protocol setting with helper functions.

get_protocol For automated extracting of protocols from raw data.

Examples

set_protocol_manual(
  duration = c(300, 120, 300, 60, 300),
  load = c(3, 5, 3, 6, 3)
)

# using a data.frame as input
pt_data <- data.frame(
  duration = c(180, 150, 120, 90, 60, 30),
  load = c(200, 250, 300, 350, 400, 450)
)
set_protocol_manual(pt_data)

spiro documentation built on Aug. 14, 2023, 5:07 p.m.