On 10/17/09, Julius Tesoro <jutesoro at yahoo.com>
wrote:> I am looking at the plyr package and I am intrigued at how data(i.e.
ozone, baseball) is loaded without having to type data(ozone). Are they
automatically loaded when i call library(plyr)? I want to do the same thing when
I make my package. How does one accomplish this?
>
I don't know how this is achieved, but try looking at the source code
for the package.
> Also, are there any beginner guides on how to make a package?
>
I would not call this a beginner's guide, but here's the standard
reference [1]. This is what I wrote some time ago in an off-list
message:
"When I published my first (and still only) R package I also found it
daunting to get it working. Perhaps the easiest way to get it
going---at least it worked for me---would be to:
- take the source archive of an existing package with a
very-simple-structure (nortest or even Rcmdr) or a package that would
be very similar to what you need [consider the potential licence issues, though]
- get rid of/replace files as needed
- not forget to run R CMD check (to check that the code conforms to
CRAN requirements) and R CMD build (to build the release tarball)
- then what rests to do is drop the latter on the CRAN FTP server."
It's been some time that I did this, so there might be some missing
step. Hope this is of help. Best,
Liviu
[1] http://cran.r-project.org/doc/manuals/R-exts.pdf