[R] Problem with package development

Nipesh Bajaj bajaj141003 at gmail.com
Thu Jun 2 20:30:03 CEST 2011


What else I need to do? In the Read-and-delete-me file following steps
are asked to perform:
* Edit the help file skeletons in 'man', possibly combining help files
for multiple functions.
* Edit the exports in 'NAMESPACE', and add necessary imports.
* Put any C/C++/Fortran code in 'src'.
* If you have compiled code, add a useDynLib() directive to 'NAMESPACE'.
* Run R CMD build to build the package tarball.
* Run R CMD check to check the package tarball.

I editied the help page for fn1() function (as I already communicated
in previous mail) as follows:
\name{fn1}
\alias{fn1}

\title{
A function.
}

\description{
A function.
}

\usage{
A function.
}

\arguments{
A function.
}

\value{
A function.
}

\author{
\bold{Me}
\cr
\email{Me at me.com}
}

And regarding th Namespace file, this time I put
"package.skeleton("trial1",namespace = FALSE, code_files =
"f:/trial.r")
"

I do not have any C/C++ code so I ignored 3rd step.

then Read-and-delete-me file asking me to build the package, so in
cmd, I run following:
cd C:\R_PackageBuild
Rcmd build –binary trial1

What I am missing in this entire process? Do you please point me?

Thanks,


On Thu, Jun 2, 2011 at 11:40 PM, Duncan Murdoch
<murdoch.duncan at gmail.com> wrote:
> On 02/06/2011 2:03 PM, Nipesh Bajaj wrote:
>>
>> Thanks Prof. Ripley and Duncan for your pointers. Noting down your
>> points I have modified my way of building package and have done
>> following so far:
>>
>> 1. In my C: drive I create one working folder naming "R_PackageBuild"
>> 2. In R console I have written following codes:
>> >  setwd("c:/R_packageBuild")
>> >  package.skeleton("trial1",namespace = TRUE, code_files = "f:/trial.r")
>> 3. then I opened cmd and wrote following:
>> cd C:\R_PackageBuild
>> Rcmd build –binary trial1
>>
>> This process halted with following error:
>> Error: unexpected symbol in “tools:::.test_load_package(‘trial1′,….)”
>> Execution halted
>> ERROR: loading failed
>>
>> What I have missed in this process? Can you please help me how to
>> solve this issue?
>
> You haven't done the manual changes required between steps 2 and 3.
>  package.skeleton() creates the skeleton of a package; you run it once as
> you are starting development, the do a lot of manual updates, described on
> the ?package.skeleton help page, and in the  ‘Read-and-delete-me’ file.
>  Once those are done, step 3 should succeed.
>
> Duncan Murdoch
>
>> Thanks,
>>
>> PS: I am sorry I missplet 'Program Files'. Thanks Prof. Ripley for this
>> pointer.
>>
>> On Wed, Jun 1, 2011 at 11:41 AM, Prof Brian Ripley
>> <ripley at stats.ox.ac.uk>  wrote:
>> >  On Wed, 1 Jun 2011, Nipesh Bajaj wrote:
>> >
>> >>  I have been struggling for last one hour but not yet any through.
>> >>
>> >>  However again I recreate the package.skeleton and run R CMD check
>> >> trial3
>> >>
>> >>  Here are the errors:
>> >>
>> >>  warning in dir.create(pkgoutdir, mode = "0755"):
>> >>  cannot create dir 'c:\Program files\R\R-2.13.0\bin\trial3.Rcheck',
>> >>  reason .................
>> >>  Error in printLog(Log, "", text, "\n"): object 'Log' not found
>> >>  Execution haulted
>> >>
>> >>  Why I am getting this error? what is that "Log". I will really
>> >>  appreciate if somebody please help me to figure out.
>> >
>> >  R CMD check writes a (in your case) trial3.Rcheck directory, and in
>> > there in
>> >  file 00check.log a copy of the log.  If it cannot create trial3.Rcheck
>> > it
>> >  cannot write the log.
>> >
>> >  I would be surprised that even on Windows Vista the message was
>> > literally
>> >
>> >>  reason .................
>> >
>> >  but if it was, blame Microsoft for their error messages.
>> >  But
>> >>
>> >>  cannot create dir 'c:\Program files\R\R-2.13.0\bin\trial3.Rcheck',
>> >
>> >  is clear enough.  You need to run 'R CMD check' in your user area.
>> >  In case you did this because that is where you though 'R' was, it is
>> > not the
>> >  correct R.exe.   You may need to add
>> >
>> >  c:\Program Files\R\R-2.13.0\bin\i386
>> >
>> >  (assuming 32-bit R) to your path.
>> >
>> >  However, your use of e.g. 'Program files' suggests you are not
>> > accurately
>> >  transmitting the messages you got.
>> >
>> >
>> >>
>> >>  Thanks,
>> >>
>> >>  On Wed, Jun 1, 2011 at 1:20 AM, Nipesh Bajaj<bajaj141003 at gmail.com>
>> >>  wrote:
>> >>>
>> >>>  Actually partly I followed. Here is the more details what I have done
>> >>> so
>> >>>  far:
>> >>>
>> >>>  1. Edit the help file skeletons in 'man', possibly combining help
>> >>>  files for multiple functions.
>> >>>  I have modified with following:
>> >>>  \name{fn1}
>> >>>  \alias{fn1}
>> >>>
>> >>>  \title{
>> >>>  A function.
>> >>>  }
>> >>>
>> >>>  \description{
>> >>>  A function.
>> >>>  }
>> >>>
>> >>>  \usage{
>> >>>  A function.
>> >>>  }
>> >>>
>> >>>  \arguments{
>> >>>  A function.
>> >>>  }
>> >>>
>> >>>  \value{
>> >>>  A function.
>> >>>  }
>> >>>
>> >>>  \author{
>> >>>  \bold{Me}
>> >>>  \cr
>> >>>  \email{Me at me.com}
>> >>>  }
>> >>>
>> >>>  2. Edit the exports in 'NAMESPACE', and add necessary imports.
>> >>>  Actually I really do not know what I would do here. In the
>> >>>  corresponding file, only "exportPattern("^[[:alpha:]]+")" is there.
>> >>>  Therefore I put that unaltered.
>> >>>
>> >>>  3. Put any C/C++/Fortran code in 'src'.
>> >>>  I do not have any such code
>> >>>
>> >>>  4. If you have compiled code, add a useDynLib() directive to
>> >>> 'NAMESPACE'.
>> >>>  Again I do not know what to do, so ingored this step.
>> >>>
>> >>>  5. Run R CMD build to build the package tarball.
>> >>>  * Run R CMD check to check the package tarball.
>> >>>
>> >>>  I did not follow this step exactly. What I done is, put 'trial3'
>> >>>  folder in R/R-2.13.0bin folder (after above modification), from the
>> >>>  R-working folder. Then just run R CMD INSTALL trial3. However
>> >>>  previously with this job, I could create package effectively. After
>> >>>  updating R to the current version my problem starts.
>> >>>
>> >>>  Those are not sufficient?
>> >>>
>> >>>  Thanks,
>> >>>
>> >>>  On Wed, Jun 1, 2011 at 1:09 AM, Duncan
>> >>> Murdoch<murdoch.duncan at gmail.com>
>> >>>  wrote:
>> >>>>
>> >>>>  On 11-05-31 3:36 PM, Nipesh Bajaj wrote:
>> >>>>>
>> >>>>>  Dear all, I am having a strage problem while I was trying to build
>> >>>>> a
>> >>>>>  package. Here is my package skeleton:
>> >>>>>
>> >>>>>  fn1<- Vectorize(function(x,y,z) {
>> >>>>>                          return(x + y +z)
>> >>>>>                  }, vectorize.args = c("x"), SIMPLIFY = TRUE)
>> >>>>>  package.skeleton("trial3",namespace = TRUE)
>> >>>>
>> >>>>  Did you follow the instructions that package.skeleton printed?
>> >>>>
>> >>>>  Duncan Murdoch
>> >>>>
>> >>>>>
>> >>>>>  However when I tun "R CMD INSTALL trial3" in CMD, the execution
>> >>>>>  stopped with following message:
>> >>>>>
>> >>>>>  *** installing help indices
>> >>>>>  ** building package indices...
>> >>>>>  ** testing if install package can be loaded
>> >>>>>  Error: unexpected symbol in
>> >>>>> "tools:::test_load_package(.............."
>> >>>>>  Execution haulted
>> >>>>>  ERROR: loading failed.............
>> >>>>>
>> >>>>>  I am using R 2.13.0 in Vista with latest Rtools installed. Can
>> >>>>>  somebody guide me where I have done wrong?
>> >>>>>
>> >>>>>  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.
>> >>>>
>> >>>>
>> >>>
>> >>
>> >>  ______________________________________________
>> >>  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.
>> >>
>> >
>> >  --
>> >  Brian D. Ripley,                  ripley at stats.ox.ac.uk
>> >  Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
>> >  University of Oxford,             Tel:  +44 1865 272861 (self)
>> >  1 South Parks Road,                     +44 1865 272866 (PA)
>> >  Oxford OX1 3TG, UK                Fax:  +44 1865 272595
>
>



More information about the R-help mailing list