attrs: Add and remove attributes

attrsR Documentation

Add and remove attributes

Description

Simple tools to add and remove attributes, both normally and in-place. To remove specific attributes, set those attributes to NULL.

Usage

attrs_modify(x, ..., .set = FALSE, .args = NULL)

attrs_add(x, ..., .set = FALSE, .args = NULL)

attrs_clear(x, .set = FALSE)

attrs_rm(x, .set = FALSE)

Arguments

x

Object to add/remove attributes.

...

Named attributes, e.g 'key = value'.

.set

Should attributes be added in-place without shallow-copying x? Default is FALSE.

.args

An alternative to ... for easier programming with lists.

Value

The object x with attributes removed or added.

See Also

shallow_copy


cheapr documentation built on June 8, 2025, 11:35 a.m.