Writes the study-level file of one part of a tfl_read_study_spec()
result – what a builder changes for the whole study (the rounding of
every table, a pattern, a code list) – in the form the reader reads.
Usage
tfl_write_study_part(
study,
part = c("defaults", "patterns", "codelists", "data", "toc"),
path = NULL,
name = NULL
)Examples
d <- system.file("extdata", "spec-yaml", package = "tflspec")
s <- tfl_read_study_spec(d)
f <- tempfile(fileext = ".yml")
tfl_write_study_part(s, "defaults", f)
identical(tfl_read_study_spec(d)$defaults$content[[1]]$fn,
yaml::read_yaml(f)$content[[1]] |> names())
#> [1] TRUE