[Rd] failure in `setClass' examples

From: Sebastian Luque <spluque_at_gmail.com>
Date: Tue 22 Nov 2005 - 19:12:10 GMT


Hello,

Below is what I got running the examples from `setClass'. Could somebody please help explain why the last `setIs' call is returning the warning and whether this is expected?

R>      setClass("track",

+ representation(x="numeric", y="numeric"))
[1] "track" R> setClass("trackCurve",
+ representation("track", smooth = "numeric"))
[1] "trackCurve" R> setClass("trackMultiCurve",
+ representation(x="numeric", y="matrix", smooth="matrix"),
+ prototype = list(x=numeric(), y=matrix(0,0,0),
+ smooth= matrix(0,0,0)))
[1] "trackMultiCurve" R> try(setIs("trackMultiCurve", "trackCurve",
+ test = function(obj) {ncol(slot(obj, "y")) == 1}))
Warning message:
there is no automatic definition for as(object, "trackCurve") <- value when object has class "trackMultiCurve" and no 'replace' argument was supplied; replacement will be an error in: makeExtends(class1, class2, coerce, test, replace, by, classDef1 = classDef,
R>      setIs("trackMultiCurve", "trackCurve",

+ test = function(obj) {ncol(slot(obj, "y")) == 1},
+ coerce = function(obj) {
+ new("trackCurve",
+ x = slot(obj, "x"),
+ y = as.numeric(slot(obj,"y")),
+ smooth = as.numeric(slot(obj, "smooth")))
+ })

Warning message:
there is no automatic definition for as(object, "trackCurve") <- value when object has class "trackMultiCurve" and no 'replace' argument was supplied; replacement will be an error in: makeExtends(class1, class2, coerce, test, replace, by, classDef1 = classDef, R> version

         _
platform i486-pc-linux-gnu

arch     i486             
os       linux-gnu        
system   i486, linux-gnu  
status                    
major    2                
minor    2.0              
year     2005             
month    10               
day      06               
svn rev  35749            
language R                


Thanks in advance,

-- 
Sebastian P. Luque

______________________________________________
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Wed Nov 23 06:39:48 2005

This archive was generated by hypermail 2.1.8 : Mon 20 Feb 2006 - 03:21:34 GMT