I have a data set having a value and a group, e.g.,
Val Grp
123 "A"
231 "A"
132 "A"
234 "A"
445 "B"
345 "B"
235 "B"
345 "B"
(The original dataset would be too large to show here.)
When I now do kruskal.test(data$Val, data$Grp)
, I get an error saying all group levels must be finite.
When I check the data with is.finite()
, I can see that all values are indeed finite.
The internet does not yield a lot of information on this error, so I have hope that someone could shed light on what this error means and what the problem could be.
table(data$Grp)
?if (!all(is.finite(g)))