plot.fittedTrajectory: Plot a fitted trajectory

Description Usage Arguments Examples

View source: R/plot_trajectory.R

Description

Plot a fitted trajectory

Usage

1
2
3
4
## S3 method for class 'fittedTrajectory'
plot(x, center = FALSE, x_range = NULL,
  width = 500, height = 520, hover = NULL, checkpoints = TRUE, p = 100
  * pnorm(-3:0), x_units = c("days", "months", "years"), ...)

Arguments

x

an object returned from fit_trajectory

center

should the trajectory be centered around the median WHO standard? This is equivalent to plotting the age difference score (like height-for-age difference - HAD)

x_range

a vector specifying the range (min, max) that the superposed growth standard should span on the x-axis

width

width of the plot

height

height of the plot

hover

variable names in x$data to show on hover for each point (only variables with non-NA data will be shown)

checkpoints

should the checkpoints be plotted (if available)?

p

centiles at which to draw the WHO polygons

x_units

units of age x-axis (days, months, or years)

...

additional parameters passed to figure

Examples

1
2
3
4
5
6
mod <- get_fit(cpp, y_var = "wtkg", method = "rlm")
fit <- fit_trajectory(subset(cpp, subjid == 2), mod)
plot(fit)
plot(fit, x_units = "years")
plot(fit, center = TRUE)
plot(fit, hover = c("wtkg", "bmi", "waz", "haz"))

hafen/hbgd documentation built on March 1, 2020, 5:31 p.m.