knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)

chartcatalog

R-CMD-check R-CMD-check

The chartcatalog package contains tools to

Installation

You can install the development version chartcatalog by

install.packages("remotes")
remotes::install_github("growthcharts/chartcatalog")

There is no release on CRAN.

Example 1: Available charts in JAMES

library(chartcatalog)

The current catalogs holds r length(unique(ynames_lookup$chartcode)) Dutch charts.

library(chartcatalog)
head(ynames_lookup)
length(unique(ynames_lookup$chartcode))

The charts are subdivided into three groups:

unique(ynames_lookup$chartgrp)

There are five outcomes, but not every outcome (yname) appears in all chart groups:

with(ynames_lookup, table(chartgrp, yname))

Example 2: Chartcode creating and parsing

A chartcode identifies the type of growth chart. The code is a combination of 4--7 alphanumeric characters. The create_chartcode() and parse_chartcode() functions can be used to obtain information from the codes. For example,

parse_chartcode(c("HJAA"))

shows that chart with code "HJAA" identifies the front of the chart for Hindustan boys living in the Netherlands, design A (A4 size, 0-15 months).

Example 3: Find outcomes, chart group and growth reference

If we have a chart code, we may find its chart group and outcomes as

get_chartgrp("PJEAN26")
get_ynames("PJEAN26")

We obtain the call to the clopus package to the post-natal growth reference of weight of preterms born at a gestational age of 26 week by

call <- get_reference_call("PJEAN26", yname = "wgt")
call

This call can be stored as a shortcut to the reference. Use eval(parse(text = call)) to execute the call. Alternatively, if you have clopus installed, we may obtain the reference directly by

tb <- get_reference("PJEAN26", yname = "wgt")
slotNames(tb)
head(data.frame(tb@table@table))

More details can be found in the info slot:

tb@info

Added support for nlreferences package

library(centile)
library(nlreferences)
library(dplyr)
refcode <- get_refcode("PJEAN26", "wgt")
ref <- load_reference(refcode, pkg = "nlreferences", verbose = TRUE)
head(ref)


stefvanbuuren/chartcatalog documentation built on Dec. 8, 2024, 11:10 p.m.