[R] type converters not being saved to workspace

Joseph Wang joe at gnacademy.org
Sun Apr 9 10:22:09 CEST 2006


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"
>




More information about the R-help mailing list