我想按年龄过滤我的参与者。为此,我使用(例如):
patientage <- c(18, 18, 18, 18, 18, 19, 20, 20, 20, 21, 22, 23, 23, 24, 25, 26, 27, 28, 29, 30, 30, 31, 32, 34)
group_by(patientage) %>% count(patientage) %>% filter(patientage >17 & patientage <31)%>% sum(n)
现在我想用sum(n)
18-30 之间的所有参与者来计算。但这会导致错误代码:
> Error in as.vector(x, mode) : cannot coerce type 'closure' to
> vector of type 'any'
你能帮我吗?非常感谢。