Show line number on error when searching R script from command line
Consider the following R
file ( C:\Users\Pedro\Desktop\test.R
):
f1 <- function() {
print("A")
}
f3()
If I post this file from the R console:
options(show.error.locations=TRUE);source('C:\\Users\\Pedro\\Desktop\\test.R')
then the line number will be printed correctly with the error message:
However, if I run the above command from windows cmd prompt by doing:
R --slave --restore --no-save -e "options(show.error.locations=TRUE);source('C:\\Users\\Pedro\\Desktop\\test.R')"
Then there is no line number:
So my question is, how can I get the line number in the error message when searching for R file from windows cmd prompt?
+3
source to share