If the last line of an R script does not have a trailing newline, a
small errror is produced at the end of the script.

Small example.  If file eg.r contains one line:
getwd()
and there is no newline after the closing paren

$ R CMD BATCH eg.r

produces an error:
$ cat eg.r.Rout 

R : Copyright 2005, The R Foundation for Statistical Computing
Version 2.1.1 Patched (2005-09-01), ISBN 3-900051-07-0

...

> getwd()proc.time()
Error: syntax error
Execution halted
$ 

Is it worth changing the BATCH script so that it adds a newline before
adding the call to proc.time()?

Stephen

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to