add_trajectory_plot: Add a column to a data frame containing trajectory / velocity...

Description Usage Arguments Examples

View source: R/plot_trelliscope.R

Description

Add a column to a data frame containing trajectory / velocity plots

Usage

1
2
3
4
5
6
7
add_trajectory_plot(dat, z = FALSE, center = FALSE, y_var = "htcm",
  x_range = NULL, nadir = FALSE, recovery = NULL, x_units = "days",
  width = 500, height = 520)

add_velocity_plot(dat, z = FALSE, center = FALSE, x_range = NULL,
  nadir = FALSE, recovery = NULL, x_units = "days", width = 500,
  height = 520)

Arguments

dat

a data frame nested by subject and containing fits from fit_all_trajectories

z

should the trajectory fit be plotted on the z-scale?

center

should the trajectory be centered around the median WHO standard?

y_var

name of y variable to model (usually an anthropometric measure or z-score scaled anthropometric measure)

x_range

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

nadir

should a guide be added to the plot showing the location of the nadir? (only valid when z = TRUE)

recovery

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

x_units

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

width

width of the plot

height

height of the plot

Examples

1
2
3
4
5
6
7
8
## Not run: 
cppsubj  <- by_subject(cpp)
cppfit   <- get_fit(cpp, method = "rlm")
cpptr    <- fit_all_trajectories(cppsubj, cppfit)
cppplot  <- trscope_trajectories(cpptr)
cppzplot <- trscope_trajectories(cpptr, z = TRUE, nadir = TRUE, x_units = "months")

## End(Not run)

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