[R] Creating datasets

Liaw, Andy andy_liaw at merck.com
Fri Jun 3 15:04:20 CEST 2005


RSiteSearch("creating datasets", restrict="doc") gives me R-exts.html as the
first hit...

I did pretty much the same thing you did and had no problem.  In the data/
directory of the source package I only have the one .rda file and nothing
else.  Did you try installing the package and test it before you run check?

Andy

> From: Jim Lemon
> 
> Hi folks,
> 
> Having lost count of the times I have read the relevant section in 
> R-exts.html (and by the way, where has that useful file gone? 
> I had to 
> look at it on CRAN.), searched for "creating datasets" (this is the 
> first time that Jon Baron's excellent search site has let me 
> down) and 
> read the idiot's guide for creating packages, I am willing to 
> admit that 
> I have failed the test.
> 
> First:
> Linux (Fedora Core 2)
> R-2.1.0
> 
> I am attempting to integrate three functions that have been kindly 
> donated to the plotrix package by Sander Oom dealing with 
> plotting soil 
> texture. Everything works okay, but I want to add a dataset to the 
> package. R-exts says that three types of data files are okay:
> 
> R code, rectangular tables (e.g. CSV) or files created by save (.rda)
> 
> I note that all the "real" packages (oops, bundles) like MASS 
> have three 
> files in their data directory that look like an index of the 
> datasets, 
> the datasets themselves and something I haven't worked out yet. I 
> haven't found a description of how to do that trick.
> 
> Thus I created the dataset by reading a CSV data file into a 
> data frame
> 
> oksoil<-read.table("oksoil.csv",sep=",")
> 
> That data frame works fine in all the functions. Then I saved it:
> 
> save(oksoil,file="/home/jim/R/plotrix/data/oksoil.rda")
> 
> But when I check the package, the examples don't work:
> 
> R CMD check /home/jim/R/plotrix
> ...
>  >  data(oksoil)
> Warning in data(oksoil) : data set 'oksoil' not found
>  >  # first just show the soil triangle
>  >  soil.texture()
>  >  # now plot the observations
>  >  show.soil.texture(oksoil)
> Error in show.soil.texture(oksoil) : Object "oksoil" not found
> Execution halted
> 
> I promise to try writing an "Idiot's Guide to Creating Datasets" if 
> someone can provide a method.
> 
> Jim
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
> 
> 
>




More information about the R-help mailing list