add_fields: Add Fields to oClasses and Other Objects

View source: R/alter.R

add_fieldsR Documentation

Add Fields to oClasses and Other Objects

Description

For environments, oClass instances and generator, add_fields is a wrapper for list2env; it adds the objects in ... the environment if they are named. For list and other objects, it behaves similar to appending ... as a list.

Usage

add_fields(x, ...)

Arguments

x

oClass instance, generator, environment, list, or other object

...

named objects to be added to x

Value

object of same type as x or list

Examples

clown <- oClass("clown")
add_fields(clown, laugh = "haha", is_funny=TRUE)

clown$laugh


oops documentation built on March 18, 2022, 5:16 p.m.