powered by
Functions for constructing named lists and S3 objects.
LIST (…) EXTEND (object, class, …)
An object.
String, giving the class name. Can be a character vector, in which case, subclasses precede superclasses. Also, can be NULL or missing.
A list of name=value pairs, or objects.
The LIST function constructs/returns a named list, automatically naming it's elements, if names aren't supplied.
The EXTEND function constructs/returns an S3 object, by prepending the (optional) new class to the existing classes, and then assigning attributes.
Note that it's possible to combine the with/EXTEND functions, to take attribute values from a named list.
# NOT RUN { object <- x <- y <- z <- 1 LIST (x, y, z=0, k=z) EXTEND (object, "something", x, y, z=0, k=z) # }
Run the code above in your browser using DataLab