Dear All,
I am trying to write my first R script. The code is simply
cat("Hello!\n")
However, when I run
$ R CMD BATCH myscript.R
I do not see "Hello!" on the console. I am using Fedora 7 (Linux) and
R-2.5.1.
Any ideas?
Thanks in advance,
Paul
Paul Smith wrote:> Dear All, > > I am trying to write my first R script. The code is simply > > cat("Hello!\n") > > However, when I run > > $ R CMD BATCH myscript.R > > I do not see "Hello!" on the console. I am using Fedora 7 (Linux) and R-2.5.1. > > Any ideas? >You shouldn't see it on the console! BATCH writes its output to a file. You should find a file called myscript.Rout that does contain the 'Hello!'. Barry
Use rscript
Rscript myscript.R
or
Rscript -e 'cat("Hello!\n")'
will show Hello! on the console.
R CMD BATCH writes its output to the file myscript.Rout
Paul Smith wrote:>
> Dear All,
>
> I am trying to write my first R script. The code is simply
>
> cat("Hello!\n")
>
> However, when I run
>
> $ R CMD BATCH myscript.R
>
> I do not see "Hello!" on the console. I am using Fedora 7 (Linux)
and
> R-2.5.1.
>
> Any ideas?
>
> Thanks in advance,
>
> Paul
>
--
View this message in context:
http://www.nabble.com/R-CMD-BATCH%3A-cat-does-not-print-tf4353572.html#a12405494
Sent from the R help mailing list archive at Nabble.com.