zap_attr {summarytools} | R Documentation |
Remove Attributes to Get a Simplified Object
Description
Get rid of summarytools-specific attributes to get a simple data structure (matrix, array, ...), which can be easily manipulated.
Usage
zap_attr(x, except = c("dim", "dimnames"))
Arguments
x |
An object with attributes |
except |
Character. A vector of attribute names to preserve. By default, “dim” and “dimnames” are preserved. |
Details
If the object contains grouped results:
The inner objects will lose their attributes
The “stby” class will be replaced with “by”
The “dim” and “dimnames” attributes will be set to available relevant values, but expect slight differences between objects created with
stby()
vsgroup_by()
.
Examples
data(tobacco)
zap_attr(descr(tobacco))
zap_attr(freq(tobacco$gender))
[Package summarytools version 1.1.4 Index]