Serialises a herald_spec object to a herald JSON file.
Requires the jsonlite package.
See also
Other specification:
apply_spec(),
coerce_types(),
decode_var(),
detect_adam_class(),
detect_adam_classes(),
drop_unspec_vars(),
herald_spec(),
herald_spec_from_fixture(),
order_cols(),
read_spec(),
read_spec_define(),
retained_variable_convention(),
scaffold_vars(),
sort_keys(),
spec_codelist(),
spec_datasets(),
spec_study(),
spec_vars(),
variable_codelist(),
variable_is_required(),
write_define_html(),
write_define_xml()
Examples
spec <- herald_spec(
ds_spec = data.frame(dataset = "DM", label = "Demographics",
stringsAsFactors = FALSE),
var_spec = data.frame(dataset = "DM", variable = "STUDYID",
label = "Study ID", data_type = "text",
length = "12", stringsAsFactors = FALSE)
)
tmp <- tempfile(fileext = ".json")
on.exit(unlink(tmp))
write_spec(spec, tmp)
