search for: s3part

Displaying 6 results from an estimated 6 matches for "s3part".

2010 Jul 12
1
S4 class extends "data.frame", getDataPart sees "list"
R-Devel: When I get the data part of an S4 class that contains="data.frame", it gives me a list, even when the "data.frame" is the S4 version: > d<-data.frame(x=1:3) > isS4(d) [1] FALSE # of course > dS4<-new("data.frame",d) > isS4(dS4) [1] TRUE # ok > class(dS4) [1] "data.frame"
2010 Jun 13
1
S4 classes and S3 generic functions
...selection uses the contents of 'extends(class(x))' as the equivalent of the S3 inheritance (the inheritance is cached after the first call). An existing S3 method may not behave as desired for an S4 subclass, in which case utilities such as 'asS3' and 'S3Part' may be useful. If the S3 method fails on the S4 object, 'asS3(x)' may be passed instead; if the object returned by the S3 method needs to be incorporated in the S4 object, the replacement function for 'S3Part' may be useful, as in the method for class &...
2016 Jan 05
2
For integer vectors, `as(x, "numeric")` has no effect.
...r vector to "numeric" by the call to as() in setDataPart()). Here's the test and its outcome: setClass("NumX", contains="numeric", representation(id="character")) nn = new("NumX", 1:10, id="test") stopifnot(identical(1:10, S3Part(nn, strict = TRUE))) ## Error: identical(1:10, S3Part(nn, strict = TRUE)) is not TRUE ## Execution halted >>> On Dec 11, 2015, at 1:25 AM, Martin Maechler <maechler at stat.math.ethz.ch> wrote: > >>>>>>>>> Martin Maechler <maechler at stat....
2015 May 28
3
S4 inheritance and old class
Hey everyone, I would like to develop a package using S4 classes. I have to define several S4 classes that inherits from each others as follow: # A <- B <- C <- D I also would like to define .DollarNames methods for these class so, if I have understood well, I also have to define an old class as follow: # AOld <- A <- B <- C <- D setOldClass(Classes = "AOld")
2008 Oct 20
2
R 2.8.0 is released
...defined corresponding to "...", by creating a generic function that has "..." as its signature. A method will be selected and called if all the arguments matching "..." are from this class or a subclass. See ?dotsMethods. o New functions S3Part() and S3Class() provide access to the corresponding S3 object and class for S4 classes that extend either an S3 class or a basic R object type. o show(<class definition>) now also shows the class name. INSTALLATION o If sub-architectures are used, a copy of Rscr...
2008 Oct 20
2
R 2.8.0 is released
...defined corresponding to "...", by creating a generic function that has "..." as its signature. A method will be selected and called if all the arguments matching "..." are from this class or a subclass. See ?dotsMethods. o New functions S3Part() and S3Class() provide access to the corresponding S3 object and class for S4 classes that extend either an S3 class or a basic R object type. o show(<class definition>) now also shows the class name. INSTALLATION o If sub-architectures are used, a copy of Rscr...