Read .R file into character
read_script.Rd
Arguments
- file
(
character
) File to be parsed into code- dataname
(
character
) dataset name to subset code from chunks
Examples
file_example <- tempfile()
writeLines(c("x <- 2", "#second line comment", "x <- x + 2"), file_example)
read_script(file_example)
#> [1] "x <- 2\nx <- x + 2"