Displaying 1 result from an estimated 1 matches for "iqtr4".
Did you mean:
qtr4
2010 Jun 08
2
Extract/format/show for S4 objects
...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 (object) {
cat(format(yearqtr(as.numeric(x) * 0.25 + 2000)))
})
I have two issues:
1. Vectors of iqtrs do not display properly.
They print, but they don't look like vectors.
> iq <- iqtr(seq(2000, 2002, 0.25))
&...