I am on Mac OS 10.10 with R 3.1.1
I have the following dataframe x
which I am trying to get its descriptive statistics using describe
from psych
package (note that I Hmisc
package which has the same describe
function is detached for now)
set.seed(10)
x<-data.frame(a=seq(1:10),b=rnorm(10), c=rnorm(10))
x_des<-psych::describe(x)
x_des<-x_des[,-c(3,4,5)]
this code gives me the object x_dex
which has a data.frame
class.
If I load Hmisc
package, the class of the object x_dex
changes to describe
if I used the same code like above.
Since I want the object to have a data.frame
class to be able to write it into excel file, I have tried to use:
data.frame(x_des)
but it give the following error:
Error in as.data.frame.default(x[[i]], optional = TRUE, stringsAsFactors = stringsAsFactors) :
cannot coerce class ""describe"" to a data.frame
Need to know why this happen when loading Hmisc
package and any proper solution.