View source: R/trackeRdata_plot.R
plot.trackeRdata | R Documentation |
Plot training sessions in form of trackeRdata objects
## 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,
...
)
x |
An object of class |
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 |
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
|
moving_threshold |
A named vector of 3 speeds to be used for
thresholding pace, given in the unit of the speed measurements
in |
... |
Further arguments to be passed to
|
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
.
trackeRdata
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.