getSrcFilename(x, full.names = FALSE, unique = TRUE) getSrcDirectory(x, unique = TRUE) getSrcref(x) getSrcLocation(x, which = c("line", "column", "byte", "parse"), first = TRUE)
getSrcFilename
getSrcDirectory
getSrcref returns a list of "srcref" objects or NULL if there are none.
getSrcref
"srcref"
NULL
getSrcLocation returns an integer vector of the requested type of locations.
getSrcLocation
"keep.source"
TRUE
The components are as follows: [object Object],[object Object],[object Object],[object Object]
srcref
getParseData
fn <- function(x) { x + 1 # A comment, kept as part of the source } # Show the temporary file directory # where the example was saved getSrcDirectory(fn) getSrcLocation(fn, "line")
Run the code above in your browser using DataLab