StripAttr.Rd
For convenience we sometimes want to strip some or all attributes in a oneliner.
SetAttr(x, attr, attr_val)
StripAttr(x, attr_names = NULL)
the object x
without the attributes contained in attr_names
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")
#> [1] 0.24328759 0.30786605 0.75004037 0.55682973 0.03600083 0.20518696
#> [7] 0.47469498 0.59731519 0.34923963 0.43360660
#> attr(,"some_attr")
#> [1] "First attribute"
# strip all attributes
StripAttr(x)
#> [1] 0.24328759 0.30786605 0.75004037 0.55682973 0.03600083 0.20518696
#> [7] 0.47469498 0.59731519 0.34923963 0.43360660