我正在尝试为数据集的每一列计算NA值,我能够获取此信息,但是现在我试图对其进行汇总,然后将信息放入数据框中。
数据集(细分)-
data_matrix = as.data.frame(matrix(0,nrow = 4, ncol=2))
colnames(data_matrix) = c("Number missing","Frequency")
data_matrix$`Number missing` = c(0,1,2,3)
missing = sapply(segment, function(x) sum(is.na(x)))
# Missing output
# KJIS10 CSDF32 X ASDF67
# 0 0 3 2
# What I'm trying to achieve
# Amount Missing Frequency
# 0 2
# 1 0
# 2 1
# 3 1
丢失量是每列丢失的数据量。没有列丢失的数据超过3条。我将如何进行这种计数?