Any one can explain why this happens or any work arounds?

> setClass('foo')
[1] "foo"
> setAs('foo', 'character', function(from) from)
> showMethods('coerce')

Function "coerce":
from = "ANY", to = "array"
from = "ANY", to = "call"
from = "ANY", to = "character"
from = "ANY", to = "complex"
from = "ANY", to = "environment"
from = "ANY", to = "expression"
from = "ANY", to = "function"
from = "ANY", to = "integer"
from = "ANY", to = "list"
from = "ANY", to = "logical"
from = "ANY", to = "matrix"
from = "ANY", to = "name"
from = "ANY", to = "numeric"
from = "ANY", to = "single"
from = "ANY", to = "ts"
from = "ANY", to = "vector"
from = "ANY", to = "NULL"
from = "foo", to = "character"
> q()
Save workspace image? [y/n/c]: y


(restart)

> showMethods('coerce')

Function "coerce":
from = "ANY", to = "array"
from = "ANY", to = "call"
from = "ANY", to = "character"
from = "ANY", to = "complex"
from = "ANY", to = "environment"
from = "ANY", to = "expression"
from = "ANY", to = "function"
from = "ANY", to = "integer"
from = "ANY", to = "list"
from = "ANY", to = "logical"
from = "ANY", to = "matrix"
from = "ANY", to = "name"
from = "ANY", to = "numeric"
from = "ANY", to = "single"
from = "ANY", to = "ts"
from = "ANY", to = "vector"
from = "ANY", to = "NULL"
from = "NULL", to = "OptionalFunction"
>

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to