Takes an S7 object and coerces it to the appropriate vector container type.
from_vector() builds an instance of class from a vector. Both are S7
generics which can be implemented for any custom types.
Value
as_vector() returns an atomic vector or a named list.
from_vector() returns an instance of class, or x unchanged.
Details
as_vector() returns:
S7_object: a named list of its coerced properties.Enum: its value as a string.list: a list with each S7 object or bare list element coerced. It leaves other elements, such as data frames, unchanged.Falls back to use
as.list().
from_vector() builds class from the properties in x. It returns atomic
vectors unchanged and unclasses data frames first.