View source: R/add_attribute.R
get_wmisc_attributes | R Documentation |
Functions to retrieve or modify the "wmisc" attributes of an object.
get_wmisc_attributes(x)
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. |
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.
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.
attributes()
, attr()
# 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.