[Rd] Rscript again
simon.urbanek at r-project.org
Mon Apr 30 17:01:26 CEST 2007
On a similar note the example doesn't seem to work, either, due to
$ Rscript -e 'format(Sys.time(), "%a %b %d %X %Y")'
ARGUMENT '"%a' __ignored__
ARGUMENT '%b' __ignored__
ARGUMENT '%d' __ignored__
ARGUMENT '%X' __ignored__
ARGUMENT '%Y")' __ignored__
It works only if you remove all spaces from the expression:
$ Rscript -e 'format(Sys.time(),paste("%a","%b","%d","%X","%Y"))'
 "Mon Apr 30 10:45:47 AM 2007"
(Tested on i686 Debian etch Linux and Mac OS X 10.4.9 i686; bash,
dash and csh show the same behavior; R 2.5.0 and R-devel 41383).
Although Rscript tries hard to pass the expression as one argument,
it apparently doesn't prevent the shell from not taking it apart when
calling Rexec from R.sh :/
On Apr 30, 2007, at 10:07 AM, S.J.Eglen at damtp.cam.ac.uk wrote:
> One of the examples in Rscript.Rd seems mis-formatted, in that the
> format statement is incomplete:
> ## Not run:
> Rscript -e 'date()' -e 'format(Sys.time(), "
> Both Rscript.Rd in R 2.5.0 and the version at:
> Rscript -e 'date()' -e 'format(Sys.time(), "%a %b %d %X %Y")'
> Do the % need replacing with \% ?
> R version 2.5.0 (2007-04-23)
> attached base packages:
>  "stats" "grDevices" "utils" "datasets" "graphics"
>  "base"
> R-devel at r-project.org mailing list
More information about the R-devel