[R] Seeking help in Package development

Nipesh Bajaj bajaj141003 at gmail.com
Sat Feb 19 23:31:49 CET 2011


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'

In my Package, there are 2 user defined functions MyFunction1 &
MyFunction2, 1st function just get the length of it's argument and 2nd
function get the Range. I have modified the manual pages of those 2
functions as (just 1st few lines):

\name{MyFunction1}
\alias{MyFunction1}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
  ~~(Title) This function try to get the length of it's arguments ~~
}
\description{
  ~~ (Description) This function try to get the length of it's arguments ~~
}
\usage{
MyFunction1(x)
}

\name{MyFunction2}
\alias{MyFunction2}
%- Also NEED an '\alias' for EACH other topic documented here.
\title{
  ~~(Title) This function try to get the range of it's arguments ~~
}
\description{
%%  ~~ A concise (1-5 lines) description of what the function does. ~~
}
\usage{
MyFunction2(x)
}

I understand there is something to do with the 'title' segments of any
(or all) those 2 functions. However could not find what to do. Any
point please?

Actually I wanted to create .zip file as I am working in Vista. For
that I have intalled R_tool as well. However I could not understand
how I can use that. Any help will be highly appreciated.

Thanks,
On Sun, Feb 20, 2011 at 3:22 AM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote:
> On Sat, Feb 19, 2011 at 4: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.
>>
>> Can somebody please guide me what to do in this situation?
>>
>
> You have to modify you path, adding the directory containing R.exe so
> that Windows can find R.
>
> Alternately you can download R.bat from batchfiles.googlecode.com and
> place it anywhere on your path to avoid having to modify your path
> itself.  It will find R from the registry and run it with the same
> arguments.
>
>
> --
> Statistics & Software Consulting
> GKX Group, GKX Associates Inc.
> tel: 1-877-GKX-GROUP
> email: ggrothendieck at gmail.com
>



More information about the R-help mailing list