Table of Contents

R - Coerce methods (Object Class conversion)

About

Type Coercion in R.

The function as turns object into an object of class Class. In doing so, it applies a “coerce method”.

The implicitly defined coerce methods may be overridden by a call to setAs.

Signature

Coerce methods have two arguments in method signatures:

These functions must not be called directly, but are used to store tables of methods for the use of as, directly and for replacements.

Method

showMethods("coerce")
Function: coerce (package methods)
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="NULL"
from="ANY", to="numeric"
from="ANY", to="S3"
from="ANY", to="S4"
from="ANY", to="ts"
from="ANY", to="vector"
from="character", to="signature"
from="character", to="SuperClassMethod"
from="color", to="HLS"
from="color", to="HSV"
from="color", to="LAB"
from="color", to="LUV"
from="color", to="polarLAB"
from="color", to="polarLUV"
from="color", to="RGB"
from="color", to="sRGB"
from="color", to="XYZ"
from="derivedDefaultMethod", to="function"
from="function", to="classGeneratorFunction"
from="function", to="OptionalFunction"
from="groupGenericFunction", to="genericFunction"
from="NULL", to="OptionalFunction"
from="NULL", to="optionalMethod"
from="oldClass", to="S3"

Documentation / Reference

?coerce
?as