plot.trackeRdata: Plot training sessions in form of trackeRdata objects

View source: R/trackeRdata_plot.R

plot.trackeRdataR Documentation

Plot training sessions in form of trackeRdata objects

Description

Plot training sessions in form of trackeRdata objects

Usage

## S3 method for class 'trackeRdata'
plot(
  x,
  session = NULL,
  what = c("pace", "heart_rate"),
  threshold = TRUE,
  smooth = FALSE,
  trend = TRUE,
  dates = TRUE,
  unit_reference_sport = NULL,
  moving_threshold = NULL,
  ...
)

Arguments

x

An object of class trackeRdata.

session

A numeric vector of the sessions to be plotted, defaults to all sessions.

what

Which variables should be plotted? A vector with at least one of "latitude", "longitude", "altitude", "distance", "heart_rate", "speed", "cadence_running", "cadence_cycling", "power", "temperature", "pace", "cumulative_elevation_gain". Default is c("pace", "heart_rate").

threshold

Logical. Should thresholds be applied?

smooth

Logical. Should the data be smoothed?

trend

Logical. Should a smooth trend be plotted?

dates

Logical. Should the date of the session be used in the panel header?

unit_reference_sport

The sport to inherit units from (default is taken to be the most frequent sport in object).

moving_threshold

A named vector of 3 speeds to be used for thresholding pace, given in the unit of the speed measurements in object. If NULL (default), the speeds are taken to be c(cycling = 2, running = 1, swimming = 0.5). See Details.

...

Further arguments to be passed to threshold and smootherControl.trackeRdata.

Details

Note that a threshold is always applied to the pace. This (upper) threshold corresponds to a speed of 1.4 meters per second, the preferred walking speed of humans. The lower threshold is 0.

The units for the variables match those of the sport specified by unit_reference_sport.

See Also

trackeRdata

Examples

## Not run: 
data('runs', package = 'trackeR')
## plot heart rate and pace for the first 3 sessions
plot(runs, session = 1:3)
## plot raw speed data for session 4
plot(runs, session = 4, what = "speed", threshold = FALSE, smooth = FALSE)
## threshold speed variable
plot(runs, session = 4, what = "speed", threshold = TRUE, smooth = FALSE,
    variable = "speed", lower = 0, upper = 10)
## and smooth (thresholding with default values)
plot(runs, session = 4, what = "speed", threshold = TRUE,
    smooth = TRUE, width = 15, parallel = FALSE)
#'
## Speed and elevation gain
plot(runs, session = 2:10, what = c("speed", "cumulative_elevation_gain"), trend = FALSE)

## End(Not run)


hfrick/trackeR documentation built on Feb. 3, 2024, 2:30 p.m.