本文于2026-03-31更新。 如发现问题或者有建议,欢迎提交 Issue
相关笔记已经整理到 Gitbook 上。
1 skimr
library(skimr)
skim(chickwts)
- 注意看,这里有几种信息,关键是变量名称作为变量,可以看好几百变量的table。
1.1 连续变量
- 但是耗时太长,因此不建议使用,这里推荐
psych::describe, 具体参考 因子分析 Factor Analysis
psych::describe(chickwts)
Variable type: numeric
variable missing complete n mean sd p0 p25 median p75 p100 hist
weight 0 71 71 261.31 78.07 108 204.5 258 323.5 423 ▃▅▅▇▃▇▂▂
反馈缺失值。
missing complete n n_unique
0 71 71 6
反馈均值和标准差。
Variable type: numeric
mean sd
261.31 78.07
对于有skew的,代表了直方图。
p0 p25 median p75 p100
108 204.5 258 323.5 423
还可以看hist。
hist
▃▅▅▇▃▇▂▂
1.2 分类变量
Variable type: factor
variable missing complete n n_unique top_counts ordered
feed 0 71 71 6 soy: 14, cas: 12, lin: 12, sun: 12 FALSE
唯一值
n_unique
6
各分类的数量
top_counts
soy: 14, cas: 12, lin: 12, sun: 12
很棒的包,替代了str()了。