FILE.R <- tempfile(fileext = ".R")
writeLines("fun <- function ()
{
message(sprintf('invalid value %d at %s, line %d',
-1, FILE(), LINE()))
}
", FILE.R)
source(FILE.R, verbose = FALSE, keep.source = TRUE)
fun()
unlink(FILE.R)
Run the code above in your browser using DataLab