Convert S4 objects to lists and vice versa. Useful for declassing an S4
object while keeping track of it's class using attributes (see section
S4 Class Definition Attributes below for more details). Both
ListToS4
and S4ToList
are recursive functions, affecting all
lists/S4 objects contained as sub-lists/sub-objects.
S4ToList(object)IsS4List(x)
ListToS4(x)
# S3 method for default
S4ToList(object)
# S3 method for list
S4ToList(object)
S4ToList
: A list with an S4 class definition attribute
IsS4List
: TRUE
if x
is a list with an S4 class
definition attribute
ListToS4
: An S4 object as defined by the S4 class definition
attribute
An S4 object
A list with an S4 class definition attribute
S4 classes are scoped to the package and class name. In order to properly
track which class a list is generated from in order to build a new one,
these function use an attribute
to denote the
class name and package of origin. This attribute is stored as
“classDef” and takes the form of “package:class
”.