Load CDISCTealDataset
object from a file
cdisc_dataset_file.Rd
Please note that the script has to end with a call creating desired object. The error will be raised otherwise.
Usage
cdisc_dataset_file(path, code = get_code(path))
Arguments
- path
(
character
) string giving the pathname of the file to read from.- code
(
character
) reproducible code to re-create object
Examples
# simple example
file_example <- tempfile(fileext = ".R")
writeLines(
text = c(
"library(teal.data)
cdisc_dataset(dataname = \"ADSL\",
x = teal.data::example_cdisc_data(\"ADSL\"),
code = \"ADSL <- teal.data::example_cdisc_data('ADSL')\")"
),
con = file_example
)
x <- cdisc_dataset_file(file_example, code = character(0))
get_code(x)
#> [1] "ADSL <- teal.data::example_cdisc_data(\"ADSL\")"