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

Nipesh Bajaj bajaj141003 at gmail.com
Thu Jun 9 21:27:28 CEST 2011


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.

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,



More information about the R-help mailing list