FILE.R <- tempfile(fileext = ".R")
writeLines(c("
LINENO()
LINENO()
## LINENO() respects #line directives
#line 15
LINENO()
#line 1218
cat(sprintf('invalid value %d at %s, line %d\\n',
-5, try.this.path(), LINENO()))
"), FILE.R)
if (getRversion() >= "4.3.0") {
source(FILE.R, echo = TRUE, verbose = FALSE,
max.deparse.length = Inf, keep.source = TRUE)
} else {
this.path:::.source(FILE.R, echo = TRUE, verbose = FALSE,
max.deparse.length = Inf, keep.source = TRUE)
}
unlink(FILE.R)
Run the code above in your browser using DataLab