Skip to contents

The function draw_chart() plots individual data on the growth chart.

Usage

calculate_dscore(
  txt = "",
  session = "",
  format = "1.0",
  output = c("table", "last_visit", "last_dscore"),
  loc = "",
  ...
)

Arguments

txt

A JSON string, URL or file with the data in JSON format. The input data adhere to specification BDS JGZ 3.2.5, and are converted to JSON according to schema.

session

Alternative to txt. Session key where input data is uploaded on sitehost.

format

String. JSON data schema version number. There are currently three schemas supported: "1.0", "1.1", "2.0" and "3.0". Formats "1.0" and "1.1" are included for backward compatibility only. Use format = "3.0" for new applications.

output

A string, either "table", "last_visit" or '"last_dscore" specifying the result. The default "table" returns a table with four columns: "date", "x" (age), "y" (D-score) and "z" (DAZ). The number of rows equals to the number of visits. If output equals "last_visit" the function returns only the last row. If output equals "last_dscore" the function returns only the D-score from the last row.

loc

Alternative to txt. Location where input data is uploaded. Argument loc is deprecated and will disappear in Nov 2022; please use session instead.

...

Ignored

Value

A table, row or scalar.

Author

Stef van Buuren 2020

Examples

fn <- system.file("testdata", "Laura_S_dev.json", package = "james")
d <- calculate_dscore(txt = fn)
#> BDS 235 (Length/height in mm): has no value
#> BDS 245 (Body weight in grammes): has no value
#> BDS 252 (Head circumference in mm): has no value