Skip to contents

Sets an attribute on an object and returns the modified object.

Usage

setAttribute(x, which, value)

Arguments

x

[any]
Your object.

which

[character(1)]
Name of the attribute to set

value

[ANY]
Value for the attribute.

Value

Changed object x.

Examples

setAttribute(list(), "foo", 1)
#> list()
#> attr(,"foo")
#> [1] 1