Skip to contents

[Stable] Comments will be excluded

Usage

read_script(file, dataname = NULL)

Arguments

file

(character) File to be parsed into code

dataname

(character) dataset name to subset code from chunks

Value

(character) vector with the code

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"