[R] Rank Amateur Question

Berend Hasselman bhh at xs4all.nl
Wed May 29 09:00:25 CEST 2013


On 28-05-2013, at 20:07, "Mark Russell" <gibsonsdad at cox.net> wrote:

> Greetings,
> 
> 
> 
> I have just downloaded R onto a 64bit PC running Microsoft 7 Home Edition
> via Rgui. I have quite a bit of programming experience, though not as a
> professional programmer. I am a Measurement and Assessment professional
> (standardized testing). I would like to be able to write R scripts, and call
> them from the command line in Rgui. After two attempts, I receive the
> following error messages
> 
> 
> 
>> R CMD BATCH test.R
> 
> Error: unexpected symbol in "R CMD"
> 
> 
> 
>> Rscript test.R
> 
> Error: unexpected symbol in "Rscript test.R"
> 
> 
> 
> These commands were taken directly from the R documents found on the
> R-project website.
> 
> 
> 
> Clearly, I am doing something wrong. The script test.R resides in the R
> directory, and includes
> 
> 
> 
> 24 + 6
> 
> 
> 
> and nothing more. The path to test.R is C:\Program Files\R\test.R
> 
> 
> 
> Any assistance would be appreciated.
> 


R CMD … and Rscript are not run from within R itself.
You probably got this from section B1 of the An Introduction to R manual.
You run these commands in a Windows console window.

In an interactive R session you use source(…….). 

?source

There is no need to put your scripts in the same directory where R is installed.
Put them somewhere in your user space.
Read the introductory manual starting from the first page:-)

Berend
 


More information about the R-help mailing list