Skip to content

Writing R Library

3 messages · Ko-Kang Kevin Wang, Brian Ripley, Douglas Bates

#
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 guess you mean a package: a library is a directory containing installed
packages.
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 ....
#
Ko-Kang Kevin Wang <kwan022 at stat.auckland.ac.nz> writes:
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._