Plots the growth chart, optionally including matches
process_chart(
target,
chartcode,
curve_interpolation = TRUE,
quiet = TRUE,
con = NULL,
dnr = NULL,
period = numeric(0),
nmatch = 0L,
user_model = 2L,
exact_sex = TRUE,
exact_ga = FALSE,
break_ties = TRUE,
show_realized = FALSE,
show_future = FALSE,
clip = TRUE,
target_height = list(show = TRUE, alpha = 0.95)
)
A list with elements "psn"
and "xyz"
, e.g. as produced by
bdsreader::read_bds()
A string with chart code
A logical indicating whether curve interpolation shoud be applied.
Logical indicating whether chart code should be
written to standard output. Default is quiet = TRUE
.
A connection on which the donor data reside. The
default (NULL
) reads from donorloader
package.
A string with the name of the donor data
(currently available are smocc
, terneuzen
,
lollypop
, pops
, 0-2
, 2-4
and 4-18
). The default (NULL
)
sets the donor data according to period[2]
.
A vector of length 2 with left and right ages
(decimal age). If length(period) == 0L
, then no curve
matching is done
Integer. Number of matches needed. When
nmatch == 0L
no matches are sought.
Model number (1-4), indicating type of model the user wants. See details.
A logical indicating whether sex should be matched exactly
A logical indicating whether gestational age should be matched exactly
A logical indicating whether ties should broken
randomly. The default (TRUE
) breaks ties randomly.
A logical indicating whether the realized growth of the target child should be drawn
A logical indicating whether the predicted growth of the target child should be drawn
A logical indicating whether clipping is needed
A list with two elements: show
(logical)
and alpha
(numeric, e.g. 0.50 or 0.95).
A gTree
that can be rendered by grid::grid.draw()
.
user_model
parameter is as follows:most recent measurement only
sex + growth curve up to current
2 + all complete covariates
3 + growth curves up to current, other measures
if (FALSE) { # \dontrun{
library(grid)
fn <- system.file("extdata", "bds_v2.0", "smocc", "Laura_S.json", package = "jamesdemodata")
target <- bdsreader::read_bds(fn)
g <- process_chart(target,
chartcode = "NJAA", show_realized = TRUE, show_future = TRUE,
dnr = "0-2", period = c(0.5, 1.1667), nmatch = 10)
grid.draw(g)
# using lollypop for matching
g <- process_chart(target,
chartcode = "NJAA", show_realized = TRUE, show_future = TRUE,
dnr = "2-4", period = c(0.5, 1.1667), nmatch = 10
)
grid.draw(g)
} # }