Dear Nipesh,
On Sat, Feb 19, 2011 at 1:39 PM, Nipesh Bajaj <bajaj141003 at gmail.com>
wrote:> Dear all, I am a new user of R and currently trying hard to develop my
> own package. Here I am following this tutorial
> 'http://www.mathfinance.cn/how-to-create-an-R-package-in-windows/'
>
> Here it says that (step 8): "open a ?command prompt? window, change
> the directory to where your package is, type the command ?R CMD build
> MonteCarloPi? to build the package, this will generate a file called
> MonteCarloPi_1.0.tar.gz. "
>
> According to that, I have opened the Windows command prompt window (a
> black screen window) and then changed the directory, where my new
> package (a folder in current working directory in R, as created by
> 'package.skeleton') is there. Then typed 'R CMD build
MyPackage' (I
> named my package as 'MyPackage'). However doing so I got following
> error in that command prompt:
>
> 'R' is not recognized as an internal or external command, operable
> program or batch file.
This suggests that either your current directory does not contain R
and you have not added the directory containing R to the PATH
environment variable in Windows. For that command to work, Windows
needs to know where to find the program to execute. You might find
this site useful for becoming more familiar with the Windows command
prompt (geared towards XP, but cmd.exe has changed little from XP to
Vista, to 7---though increasing MS is encouraging users to switch over
to using the Windows powershell):
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/ntcmds.mspx?mfr=true
>
> Can somebody please guide me what to do in this situation?
You should also read the official R manual on installing and building
R from source. Particularly pay attention to the sections for Windows
users. You may want to get Rtools and certainly follow the
instructions to add all the necessary directories to your PATH
variable. The steps will be something like:
Right click My Computer -> Click Properties -> Click Advanced -> Click
Environment Variables -> edit the variable "PATH" to include
relevant
R directories. Please note that this is not an exact step-by-step
process as it varies slightly by different versions of Windows.
Official R Installation Manual (very relevant for building packages):
http://cran.r-project.org/doc/manuals/R-admin.html
Good luck,
Josh
>
> Best thanks
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/