describe function in the
psych package is quite handy. It can be used to obtain descriptive statistics such as mean, sd, min, max, skew, kurtosis, etc. for multiple numeric variables in a data.frame.
However, I recently got an error when I was trying to extract a subset of the summary statistics from the returned object.
Error in x$descript : $ operator is invalid for atomic vectors
The problem seems to be related to the number of classes that the object has. Updating the class to data.frame allows you then treat the returned object as a normal data.frame:
myfoo <- psych::describe(mydata) class(myfoo) <- "data.frame"
So you can then do things like:
to extract skewness and kurtosis values for a set of variables.