[R] Fwd: package.sk​eleton() does not create 'data' folder

Duncan Murdoch murdoch.duncan at gmail.com
Fri Jun 10 15:18:08 CEST 2011


On 10/06/2011 9:01 AM, Nipesh Bajaj wrote:
> Dear all, somebody please look into my problem here? Does it not
> contain sufficient information? Please let me know how can I post my
> question more complete.

You could try following the posting guidelines, which suggest this 
question belongs in the R-devel list, rather than R-help.  Nevertheless, 
an answer below.
> Thanks,
>
>
> ---------- Forwarded message ----------
> From: Nipesh Bajaj<bajaj141003 at gmail.com>
> Date: Fri, Jun 10, 2011 at 12:57 AM
> Subject: package.sk​eleton() does not create 'data' folder
> To: r-help at r-project.org
>
>
> Hi again, yesterday I mailed this query however I could not see this
> on the mail list. Therefore, I am reposting it again.
>
> I was using package.skeleton() function to create the
> skeleton of my package in windows. Here is my attempt:
>
> rm(list = ls())
> setwd("F:/R_PackageBuild")
> package.skeleton("trial1", namespace = TRUE, code_files =
> "F:/R_PackageBuild/trial.r")
>
> In the trial.r file, there are 2 objects, one is a function and
> another is data. Here they are:
>
> fn1<- Vectorize(function(x,y,z) {
>                         return(x + y +z)
>                 }, SIMPLIFY = TRUE)
> Data<- rnorm(20)
>
> However my problem is that package.skeleton() does not create any data
> folder in the skeleton tree. However in the man folder there are 3 Rd
> files (as expected), naming:
> Data, fn1, trial1-package
>
> However on the contrary if my code is like below then,
> package.skeleton() creates data folder.
> >  fn1<- Vectorize(function(x,y,z) {
> + return(x + y +z)
> + }, SIMPLIFY = TRUE)
> >  Data<- rnorm(20)
> >
> >  setwd("F:/R_PackageBuild")
> >  package.skeleton("trial2")
>
> So is it that if I use 'code_files ' argument then, R would not create
> data folder?
>
> Can somebody help me what I am missing in this process? Till now, I
> create ___manually____ the data folder and within that folder
> ____manually____ put a
> RData file where only object is that 'Data'. However I believe there
> must be more elegant way to doing that.

Why?  You only call package.skeleton once in the life of your package.  
You will be making hundreds of other changes to the package.  What's 
wrong with making this one?

If you want to know how package.skeleton decides whether to create a 
data folder, just look at its source.

Duncan Murdoch

> While searching over net to settle this issue, I found a thread with
> hesding 'How to create .rda file to be used in package building',
> however this is not answering my question.
>
> 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.



More information about the R-help mailing list