View source: R/process_chart.R
process_chart | R Documentation |
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)
)
target |
A list with elements |
chartcode |
A string with chart code |
curve_interpolation |
A logical indicating whether curve interpolation shoud be applied. |
quiet |
Logical indicating whether chart code should be
written to standard output. Default is |
con |
A connection on which the donor data reside. The
default ( |
dnr |
A string with the name of the donor data
(currently available are |
period |
A vector of length 2 with left and right ages
(decimal age). If |
nmatch |
Integer. Number of matches needed. When
|
user_model |
Model number (1-4), indicating type of model the user wants. See details. |
exact_sex |
A logical indicating whether sex should be matched exactly |
exact_ga |
A logical indicating whether gestational age should be matched exactly |
break_ties |
A logical indicating whether ties should broken
randomly. The default ( |
show_realized |
A logical indicating whether the realized growth of the target child should be drawn |
show_future |
A logical indicating whether the predicted growth of the target child should be drawn |
clip |
A logical indicating whether clipping is needed |
target_height |
A list with two elements: |
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
chartcatalog::create_chartcode()
## Not run:
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)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.