StripAttr | R Documentation |
For convenience we sometimes want to strip some or all attributes in a oneliner.
SetAttr(x, attr, attr_val)
StripAttr(x, attr_names = NULL)
x |
the object whose attributes should be removed or to which an attribute should be added. |
attr |
name of a new attribute |
attr_val |
value for the new attribute |
attr_names |
a vector with attribute names, which will be removed. Leaving the default to |
the object x
without the attributes contained in attr_names
Andri Signorell <andri@signorell.net>
SetNames
, unname
x <- runif(10)
x <- SetAttr(x,
attr=c("some_attr", "other_attr"),
attr_val=c("First attribute", "Second attribute"))
# strip only single
StripAttr(x, "other_attr")
# strip all attributes
StripAttr(x)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.