📌  相关文章
📜  如何在 r 中对愤怒进行分组 - 无论代码示例

📅  最后修改于: 2022-03-11 14:58:45.553000             🧑  作者: Mango

代码示例1
df <- data.frame(name=c("r", "h", "s", "l", "e", "m"), value=c(35,20,16,40,23,40))
# get categories
df$groups <- cut(df$value, breaks=c(0,21,30,Inf))

# calculate group counts:
table(cut(df$value, breaks=c(0,21,30,Inf)))