plot_z: Plot a fitted trajectory on z-score scale

Description Usage Arguments Examples

View source: R/plot_trajectory.R

Description

Plot a fitted trajectory on z-score scale

Usage

1
2
3
plot_z(x, x_range = NULL, nadir = FALSE, recovery = NULL, width = 500,
  height = 520, hover = NULL, checkpoints = TRUE, z = -3:0,
  x_units = c("days", "months", "years"), ...)

Arguments

x

an object returned from fit_trajectory

x_range

a vector specifying the range (min, max) that the superposed z-score bands should span on the x-axis

nadir

should a guide be added to the plot showing the location of the nadir?

recovery

age in days at which to plot recovery from nadir (only valid if nadir is TRUE) - if NULL (default), will not be plotted

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)?

z

z-scores at which to draw the z-score bands

x_units

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

...

additional parameters passed to figure

Examples

1
2
3
mod <- get_fit(cpp, y_var = "wtkg", method = "rlm")
fit <- fit_trajectory(subset(cpp, subjid == 2), mod)
plot_z(fit)

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