[R] S4 classes?
Spencer Graves
spencer.graves at pdf.com
Thu Jun 3 18:46:59 CEST 2004
Thanks to Eryk Wolski, Martin Maechler, Dimitris Rizopoulos and
Uwe Ligges: I uninstalled my apparently corrupted R 1.9.0pat and
installed R 1.9.1 alpha, and at least this simple example now works.
Best Wishes,
spencer graves
Uwe Ligges wrote:
> Spencer Graves wrote:
>
>> The following example, extracted from pp. 38-42 of Chambers
>> (1998) Programming with Data (Springer), works for me in S-Plus 6.2
>> but not R 1.9.0pat, which returns the indicated error messages:
>> > setClass('track', representation(x="numeric", y="numeric"))
>> [1] "track"
>> > tr1 <- new("track", x=1:3, y=4:6)
>> > setMethod("plot",
>> + signature(x="track", y="missing"),
>> + function(x, y, ...)plot(x at x, x at y, ...)
>> + )
>> [1] "plot"
>> > plot(tr1)
>> Error in plot.window(xlim, ylim, log, asp, ...) :
>> need finite xlim values
>> In addition: Warning messages:
>> 1: no finite arguments to min; returning Inf
>> 2: no finite arguments to max; returning -Inf
>> 3: no finite arguments to min; returning Inf
>> 4: no finite arguments to max; returning -Inf
>>
>> Am I missing something or is my copy of R 1.9.0pat corrupted?
>> (This is under Windows 2000.)
>> Thanks Much!
>> Spencer Graves
>
>
>
> Works for me with R-1.9.0 Patched (2004-05-24)
>
> Uwe
>
More information about the R-help
mailing list