Reputation: 820
library(gmodels)
a <- c(4,4,4,4,4)
CrossTable(a, chisq=FALSE, prop.chisq=FALSE)
produces: Error in chisq.test(t, correct = FALSE) : 'x' must at least have 2 elements
a <- c(4,5,6,7,8)
CrossTable(a, chisq=FALSE, prop.chisq=FALSE)
produces the frequency table you'd expect.
Upvotes: 0
Views: 2577
Reputation: 1902
The result is a single cell: a count of 5 of the value 4. CrossTable()
wants at least 2 cells in the table.
Upvotes: 1