source_lines {stRoke} | R Documentation |
Source Lines from a File
Description
Sources specific lines from a file
Usage
source_lines(file, lines, ...)
Arguments
file |
A character string giving the path to the file to be sourced. |
lines |
A numeric vector of line numbers to be sourced. |
... |
Additional arguments to be passed to |
Value
The result of source
.
See Also
This function is borrowed from a gist by christophergandrud.
Examples
test_file <- tempfile(fileext = ".R")
writeLines(c("# Line 1", "2+2", "# Line 3"), test_file)
source_lines(test_file, 1:2, echo=TRUE)
[Package stRoke version 23.9.1 Index]