| TypedList-class {geva} | R Documentation |
List containing elements of the same class or inheritance.
A TypedList object
.Datalist of internal contents. Elements must match or inherit a common class
(Inherited from list)
elem.classcharacter representing the class related to the elements
Constructors
typed.list(..., elem.class = NA_character_)Creates a TypedList from the elements in ... derived from the class elem.class
Conversion and coercion
as.list(x, ...)Converts this object to list
as.typed.list.list(x, elem.class = NA_character_)Converts a list to a TypedList if its elements inherit the same type
as.typed.list(x, elem.class = NA_character_)Coerces a TypedList to support the inherited class indicated by elem.class
as.typed.list.vector(x, elem.class = NA_character_)Converts a vector to a TypedList
Properties
x[i, j, ...] <- valueSets a value to this list. The value argument must be compatible to the current list type
## Creates a TypeList that stores list-derived objects
tpls = typed.list(A=list(1L:5L),
B=data.frame(v1=LETTERS[1L:10L]),
elem.class = 'list')
# Note: The 'elem.class' above is optional, since the
# class is automatically detected from the first argument