attr: Interface to read and write attributes.

Description Usage Arguments See Also Examples

Description

Interface to easily read and write attributes.

Usage

1
2
3
x %.% which

%.%(x, which) <- value

Arguments

x

An object whose attributes are to be accessed.

which

A non-empty string specifying which attribute is to be accessed.

value

The new value of the attribute, or NULL to remove the attribute.

See Also

attr, attributes

Examples

1
2
3
4
# Create a 2 by 5 matrix:
x <- 1:10
x%.%dim <- c(2, 5)
# The previous line is identical to: attr(x, "dim") <- c(2, 5)

chgigot/cgmisc documentation built on May 14, 2019, 8:17 a.m.