Displaying 1 result from an estimated 1 matches for "iqtr".
Did you mean:
idtr
2010 Jun 08
2
Extract/format/show for S4 objects
...e been too high-level, and I can't find
any examples of implementing extract. In S3, I can use [.Date as my
example, but I can't find the equivalent for S4.
Second, is this misguided?
Now for the details. Given this start:
library(zoo) # borrowing yearqtr for output.
setClass("iqtr", contains="integer")
## Create an iqtr object from a numeric date (e.g. 2000.5).
iqtr <- function (x) {
iq <- as.integer(floor((as.numeric(x) - 2000) * 4 + 0.0001))
new("iqtr", iq)
}
setMethod("show", "iqtr4",
function...