[Rd] does isGeneric work differently in 1.8.0 ?
Thomas Stabla
a9265 at stud.uni-bayreuth.de
Sat Sep 27 22:38:32 MEST 2003
Hello,
the last command (isGeneric) in following R-code (attached) produces
different output, depending on wheter 1.8.0 alpha or 1.7.1 is used.
Is that to be expected ?
Both R Versions were started with option vanilla
---------------------------------------------------
R.1.7.1:
---------------------------------------------------
> version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status
major 1
minor 7.1
year 2003
month 06
day 16
language R
> isGeneric("foo")
[1] FALSE
> setClass("woo", representation(foo="character"), prototype = list(foo ="text"))
[1] "woo"
> if(!isGeneric("foo")) setGeneric("foo", function(object) standardGeneric("foo"))
[1] "foo"
> setMethod("foo", "woo", function(object) object at foo)
[1] "foo"
> isGeneric("foo")
[1] TRUE
---------------------------------------------------
R 1.8.1:
---------------------------------------------------
> version
_
platform i686-pc-linux-gnu
arch i686
os linux-gnu
system i686, linux-gnu
status alpha
major 1
minor 8.0
year 2003
month 09
day 25
language R
> isGeneric("foo")
[1] FALSE
> setClass("woo", representation(foo="character"), prototype = list(foo="text"))
[1] "woo"
> if(!isGeneric("foo")) setGeneric("foo", function(object) standardGeneric("foo"))
[1] "foo"
> setMethod("foo", "woo", function(object) object at foo)
[1] "foo"
> isGeneric("foo")
[1] FALSE
---------------------------------------------------
---------------------------------------------------
Greetings,
Thomas Stabla
-------------- next part --------------
version
isGeneric("foo")
setClass("woo", representation(foo = "character"), prototype = list(foo = "text"))
if(!isGeneric("foo")) setGeneric("foo", function(object) standardGeneric("foo"))
setMethod("foo", "woo", function(object) object at foo)
isGeneric("foo")
More information about the R-devel
mailing list