Hmisc描述了短版本

时间:2013-08-13 09:24:52

标签: r

有没有办法只显示describeHmisc命令的前两行输出?

出于数据安全原因,我只能在输出中显示nmissinguniquemean以及可能的直方图。

这意味着我必须隐藏lowesthighest的输出以及频率和百分位数。

这可能吗?如果不是,我可能不得不自己计算价值。

1 个答案:

答案 0 :(得分:4)

library(Hmisc)

res <- describe(rnorm(400))

#Look at the structure.
str(res)
#It's a list! You can change the objects in it.

res$counts <- res$counts[1:4]
res$values <- NULL

print(res)
#rnorm(400) 
#      n missing  unique    Mean 
#    400       0     400 0.05392 
相关问题