powered by
For convenience we sometimes want to strip some or all attributes in a oneliner.
StripAttr(x, attr_names = NULL)
the object whose attributes should be removed.
a vector with attribute names, which will be removed. Leaving the default to NULL will cause all the attributes to be deleted.
NULL
the object x without the attributes contained in attr_names
x
SetNames, unname
SetNames
unname
# NOT RUN { x <- runif(10) attr(x, "some_attr") <- "First attribute" attr(x, "other_attr") <- "Second attribute" # strip all attributes StripAttr(x) # only some StripAttr(x, "other_attr") # }
Run the code above in your browser using DataLab