Is there anything comparable to "with" for S4 objects?
EXAMPLE:
A "Wave" object in the tuneR package has slots "left" and
"right", plus others. I'd like to be able to do something like the
following:
library(tuneR)
x <- seq(0, 2*pi, length = 6)
all.equal(x, rev(x))
channel <- round(32000 * sin(440 * x))
Wobj <- Wave(left = channel, right=rev(channel))
with(Wobj, quantile(left-right))
** This last statement throws "Error ... object 'left' not found".
Is there something comparable to "with" that can do this?
Thanks,
Spencer Graves
______________________________________________
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.