[R] locked environment and inheritance

Seth Falcon sfalcon at fhcrc.org
Mon Jun 4 20:40:21 CEST 2007


johan Faux <johanfaux at yahoo.com> writes:

> Hi,
>
> I have a S3 package with namespace called "myS3Pkg". Inside my package
> I would like to create a S4 class which extends (adds 2 slots) another
> S4 class from some other package. The class should be created in
> "myPkg" environment (and not global environment).
>
> Using:
>
>
> setClass("myS4class", representation("otherS4class", mydata =
> "numeric"), where = topenv())

have you tried just omitting the where argument?  Classes will get
defined in the package environment and I think that's what you want.

+ seth
-- 
Seth Falcon | Computational Biology | Fred Hutchinson Cancer Research Center
http://bioconductor.org



More information about the R-help mailing list