Converts data in donordata
format to a JSON file per child.
export_as_bds(data, ids, path = NULL, names = NULL, indent = NULL, ...)
Dataset in donordata format (having child and time elements)
Integer vector with the id number for the individuals
Optional. Path where files should be written. By default, path
is the working directory. The function creates the path if it doesn't already
exist.
Optional. Character vector with length(ids)
elements used to
construct the file name. Spaces are replaced by underscores.
If not specified, the function uses the ids
vector to create file names.
Optional. Integer. Number of spaces to indent when using
jsonlite::prettify()
. When not specified, the function writes minified
json.
Forwarded to write_bds()
If child birth date is unknown, then 2000-01-01 is used.
Birth date of the mother is back-calculated from agem
, and thus imprecise.
names <- c("Laura S", "Thomas S")
ids <- as.integer(c(34071, 34072))
if (FALSE) { # \dontrun{
export_as_bds(minidata, ids = ids, names = names, indent = 2)
} # }