get_wmisc_attributes: Get or Set "wmisc" Attributes

View source: R/add_attribute.R

get_wmisc_attributesR Documentation

Get or Set "wmisc" Attributes

Description

Functions to retrieve or modify the "wmisc" attributes of an object.

Usage

get_wmisc_attributes(x)

Arguments

x

An object, typically a list or data structure, where the "wmisc" attribute is to be accessed or modified.

...

Additional named arguments to set or update as part of the "wmisc" attribute.

Details

  • get_wmisc_attributes(): Extracts and returns the "wmisc" attribute of the given object. If the attribute does not exist, it returns NULL.

  • set_wmisc_attributes(): Updates the "wmisc" attribute of the given object with the provided named arguments. Duplicate names are removed, with the most recently provided value taking precedence.

Value

  • For get_wmisc_attributes(): Returns the "wmisc" attribute of the object x.

  • For set_wmisc_attributes(): Returns the object x with the updated "wmisc" attribute.

See Also

attributes(), attr()

Examples

# Example object
obj <- list(a = 1, b = 2)

# Set "wmisc" attributes
obj <- set_wmisc_attributes(obj, key1 = "value1", key2 = "value2")

# Get "wmisc" attributes
get_wmisc_attributes(obj)

# Update "wmisc" attributes
obj <- set_wmisc_attributes(obj, key1 = "new_value1", key3 = "value3")
get_wmisc_attributes(obj)


jazznbass/wmisc documentation built on Jan. 28, 2025, 11:13 p.m.