Learn R Programming

rmngb (version 0.6-1)

rmAttr: Remove Attributes

Description

Remove all the attributes of an object.

Usage

rmAttr(x, except = "class")

Arguments

x
an object whose attributes should be removed.
except
character vector. Attributes that should not be removed. NULL to remove all attributes.

Value

x with its attibutes removed.

See Also

attributes.

Examples

Run this code
x <- table(sample(letters, 1e3, TRUE))
(x1 <- rmAttr(x))
class(x1 <- rmAttr(x)) # still a table, without names
(x2 <- rmAttr(x, NULL))
class(x2) # integer vector

Run the code above in your browser using DataLab