[R] Seeking help in Package development

Joshua Wiley jwiley.psych at gmail.com
Sun Feb 20 07:59:06 CET 2011


Hi Nipesh,

Although "c:/Program Files/R/R-2.12.1/bin/" may be where R.exe is
located, it is not where you want to locate your package, and, as
Gabor pointed out, it is best to keep your package outside of the main
R tree.  Your package does not need to be in the same location as
R.exe, you just need the command prompt to know where R.exe is.  If
R.exe is located in location A and your package is in location B, at
the command prompt you can change directories to A, and then tell it
to build the package found in B.  Alternately (again as I mentioned),
you can setyour PATH environment variable to include R's directory,
then it will be found automatically no matter what your current
directory is.

The cygwin warnings are okay in this case.

Unless you urgently need to develop your own package, it might be
easier to learn more about programming in R first and then try
creating a package.  The references I sent in my earlier email would
be good; I also found Software for Data Analysis: Programming with R
by John Chambers to be a very useful resource---I have read most of it
twice now and each time I feel like I have picked up on details or
nuances I missed the first time through.  It is also relatively
inexpensive.  Another helpful book is S Programming by Venables and
Ripley.

You might also consider searching the archives of the R-devel mailing
list.  Although much of it will not be relevant to general package
development, there is a lot you can learn from reading what the people
there discuss.

Cheers,

Josh

On Sat, Feb 19, 2011 at 3:19 PM, Nipesh Bajaj <bajaj141003 at gmail.com> wrote:
> Hi Gabor, can you be more detail on step 01? Is that not the correct
> path for R.exe? But I found it there.
>
> When I ran R CMD build MyPackage then actually got these warnings:
> cygwin warnings:
> MS-DOS style path detected: c:/Program Files/R/R-2.12.1/bin/Mypackage_1.0.tar
> prefered POSIX equivalent is /cygdrive/c/Program
> Files/R/R-2.12.1/bin/MyPackage_1.0.tar
> CYGWIN environment variable option "nodesfilewarning" turns off this
> warning.............
>
> Is this warning something to do with that error?
>
> Sorry for stretching this thread so long. However I am not really
> expert in programming therefore find really hard on understanding
> different terminology given in different documentation.
>
> Thanks,
>
>
> On Sun, Feb 20, 2011 at 4:35 AM, Gabor Grothendieck
> <ggrothendieck at gmail.com> wrote:
>> On Sat, Feb 19, 2011 at 5:31 PM, Nipesh Bajaj <bajaj141003 at gmail.com> wrote:
>>> Thanks Gabor for your input. Here what I have done is that:
>>>
>>> 1. Copy 'MyPackage' folder (developed by package.skeleton) into
>>> 'C:\Program Files\R\R-2.12.1\bin' (I found R.exe is there)
>>>
>>> 2. In the command prompt, I changed the working directory using "CD"
>>> command and run 'R CMD build MyPackage'
>>>
>>> 3. I have seen that a file named 'MyPackage_1.0.tar' has been created.
>>> Then I pasted that file in ''C:\Program Files\R\R-2.12.1\bin'
>>>
>>> 4. Again run R CMD INSTALL MyPackage_1.0.tar.gz. However here I got
>>> some error saying:
>>> 'Error in Rd_info(db[[i]]) : Rd files must have a non-empty \title'
>>>
>>
>> What you have done in #1 is asking for trouble.
>>
>> You do need to get used to debugging your Rd files and you should
>> expect to get many warnings and errors.  Read the messages carefully
>> and keep correcting them and rebuilding and checking until they pass.
>>
>> --
>> Statistics & Software Consulting
>> GKX Group, GKX Associates Inc.
>> tel: 1-877-GKX-GROUP
>> email: ggrothendieck at gmail.com
>>
>
> ______________________________________________
> 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/



More information about the R-help mailing list