Hi there, I'm trying to write an R library (for Windows version) when I encountered this problem. I put in a dataset called mussels into a sub-folder, data (I saw this is how it is done in other libraries). However when I load the library in R and typed: data(mussels) it complains it cannot find the data set in the library. Everything else works fine (so far), am I missing something here? Thanks, Kevin ------------------------------------------------------------------------------ Ko-Kang Kevin Wang Statistical Analysis Division Leader Software Developers' Klub (SDK) University of Auckland New Zealand -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Sat, 25 Aug 2001, Ko-Kang Kevin Wang wrote:> I'm trying to write an R library (for Windows version) when I encountered > this problem.I guess you mean a package: a library is a directory containing installed packages.> I put in a dataset called mussels into a sub-folder, data (I saw this is > how it is done in other libraries). However when I load the library in R > and typed: > data(mussels) > it complains it cannot find the data set in the library. > > Everything else works fine (so far), am I missing something here?You need to follow the instructions in `Writing R Extensions'. The @file{data} subdirectory is for additional data files the package makes available for loading using @code{data()}. Currently, data files can have one of three types as indicated by their extension: plain R code (@file{.R} or @file{.r}), tables (@file{.tab}, @file{.txt}, or @file{.csv}), or @code{save()} images (@file{.RData} or @file{.rda}). Note, `by their extension'. When all else fails, read the manual .... -- 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 272860 (secr) Oxford OX1 3TG, UK Fax: +44 1865 272595 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Ko-Kang Kevin Wang <kwan022 at stat.auckland.ac.nz> writes:> I'm trying to write an R library (for Windows version) when I encountered > this problem. > > I put in a dataset called mussels into a sub-folder, data (I saw this is > how it is done in other libraries). However when I load the library in R > and typed: > data(mussels) > it complains it cannot find the data set in the library. > > Everything else works fine (so far), am I missing something here?A quick way of getting an R package started is to use the R function package.skeleton. See its documentation - it is easy to use. -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._