[R] Dump of new Methods
G.Maubach at weinwolf.de
G.Maubach at weinwolf.de
Mon Jul 4 10:34:36 CEST 2016
Dear Readers,
Hi All,
to drive my R knowlegde a bit further I followed the advice of some of you
by reading Chambers: Programming with data.
I tried some examples from the book:
-- cut --
setClass("track", representation (x = "numeric",
y = "numeric"))
track <- function(x, y) {
# an object representing measurements 'y', tracked at positions 'x'
x <- as(x, "numeric")
y <- as(y, "numeric")
if(length(x) != length(y)) {
stop("x, y should have equal length!")
}
new("track", x = x, y = y)
}
dumpMethod("track", "track")
setMethod("show", "track",
function(object) {
xy = rbind(object at x, object at y)
dimanmes(xy) = list(c("x", "y"),
1:ncol(y))
show(xy)
})
setMethod("plot",
signature(x = "track", y = "missing"),
function(x, y, ...)
plot(unclass(x), xlab = "Position", ylab = "Value", ...)
)
dumpMethod("plot", "track")
-- cut --
Where do I find the dumped data? Is it in a single file or is every dump
stored in a separate file? Where is it stored on my drive?
Kind regards
Georg
More information about the R-help
mailing list