【发布时间】:2020-12-16 03:32:34
【问题描述】:
如果列表超过一定数量,我正在尝试获取列表的频率分布。在我的数据中,我有多个列,我想生成一个代码来标识“0”大于 3 的每一列中“0”的频率。
我的数据集是这样的:
a b c d e f g h
0 1 0 1 1 1 1 1
2 0 0 0 0 0 0 0
0 1 2 2 2 1 0 1
0 0 0 0 1 0 0 0
1 0 2 1 1 0 0 0
1 1 0 0 1 0 0 0
0 1 2 2 2 2 2 2
```
The output of the code that I need is :
```
Variable Frequency
a 4
c 4
f 4
g 5
h 4
```
So this will show us the numbers of "0" in the data frame in each column when it is greater than 3.
Thank you.
【问题讨论】:
标签: r dplyr data.table data-cleaning