write_bds | R Documentation |
This function takes a list with person and time data and saves it into JSON bds format (which can be sent to JAMES).
write_bds(
x = NULL,
auto_format = TRUE,
format = "3.0",
schema = NULL,
file = NULL,
organisation = 0L,
indent = NULL,
check = TRUE,
verbose = FALSE,
...
)
x |
List containing elements |
auto_format |
Logical. Should a field |
format |
String. JSON data schema version number. There are currently
three schemas supported: |
schema |
A file name (optionally including the path) with the JSON
validation schema.
The |
file |
File name. The default ( |
organisation |
Integer. Organisation number of the caller. Optional. |
indent |
Integer. Number of spaces to indent when using
|
check |
Logical. Should function check json to conform to schema? |
verbose |
Logical. Print file message? |
... |
Passed down to |
Functions read_bds()
and write_bds()
are inverse operations.
If the date of birth is not known, the conversion uses the
artificial birth date 01 Jan 2000
to calculate measurement
dates from age.
A string with bds-formatted JSON codes, or NULL
for invalid
JSON
Stef van Buuren 2021
jsonlite::toJSON()
fn <- system.file("extdata/bds_v1.0/smocc/Laura_S.json",
package = "jamesdemodata")
tgt <- read_bds(fn, format = "1.0", append_ddi = FALSE)
js1 <- write_bds(tgt, format = "1.0")
js2 <- write_bds(tgt, format = "2.0")
js3 <- write_bds(tgt)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.