Hello,
I have a very minimal package "simplepkg" (DESCRIPTION, NAMESPACE, and
R) with S4 classes/methods (defines a class "foo" and a show method for
that class" - both the class and show method are exported). I can
seemingly install the package, then load and use it:
> sessionInfo()
attached base packages:
Version 2.3.1 (2006-06-01)
sparc-sun-solaris2.10
[1] "methods" "stats" "graphics" "grDevices" "utils"
"datasets" "base"
> library(simplepkg,lib.loc="/home/roels/R/lib")
>
> getClass("foo")
Slots:
Name: name age
>
> myfoo <- new("foo",name="abc",age=10)
> myfoo
But when I do R CMD check, it fails (or perhaps the "errors" are really "warnings"??):
sun890% R CMD check simplepkg
* checking for working latex ... OK
Here are the file contents:
sun890% cat DESCRIPTION
Package: simplepkg
Type: Package
Title: Does stuff
Version: 0.1-1
Author: Me
Maintainer: Also Me <me@here.com>
Description: Does interesting stuff
License: GPL
sun890% cat NAMESPACE
exportClasses("foo")
exportMethods("show")
### cat simplepkg.R #class def and show method
setClass("foo",representation(name="character",age="numeric"))
setMethod("show", "foo", function(object) cat("I am ",object@name,"\n",sep=" "))
### cat zzz.R # required .onLoad for use of S4-style
classes/methods
.onLoad <- function(lib,pkg) require(methods)
As I said, the package "seems" to work, but I wanted to be sure I wasn't missing something that was going to come back to bite me later.
Thanks,
-Steve
This e-mail, including any attachments, is a confidential business communication, and may contain information that is confidential, proprietary and/or privileged. This e-mail is intended only for the individual(s) to whom it is addressed, and may not be saved, copied, printed, disclosed or used by anyone else. If you are not the(an) intended recipient, please immediately delete this e-mail from your computer system and notify the sender. Thank you.
Archive maintained by Robert King, hosted by
the discipline of
statistics at the
University of Newcastle,
Australia.
Archive generated by hypermail 2.1.8, at Wed 07 Jun 2006 - 08:10:53 EST.
Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.