我有错误,但我不知道如何解决。这是我的代码:
babbie$CHLDIDEL <- cut(babbie$CHLDIDEL, c(0, 1, 2, 3, 8))
table(babbie$CHLDIDEL)
##(0,1] (1,2] (2,3] (3,8]
## 17 502 217 153
babbie$CHLDIDEL <- cut(babbie$CHLDIDEL,c(0, 1, 2, 3, 8), include.lowest = TRUE,labels = c("0", "1", "2", "3", ">4"))
##Error in cut.default(babbie$CHLDIDEL, c(0, 1, 2, 3, 8), include.lowest = TRUE, :
## 'x' doit être numérique
table(babbie$CHLDIDEL)
##(0,1] (1,2] (2,3] (3,8]
## 17 502 217 153