Skip to content
Prev 181965 / 398513 Next

Bug in gmodels CrossTable()?

Is the code below showing a bug in Crosstable()? My expectation was that
the values produced by xtabs were rounded instead of truncated:

library(gmodels)
abc <- c("a", "a", "b", "b", "c", "c")
def <- c("d", "e", "f", "f", "d", "e")
wgt <- c(0.8, 0.6, 0.4, 0.5, 1.4, 1.3)

xtabs(wgt ~ abc + def)

CrossTable(xtabs(wgt ~ abc + def), prop.r = F, prop.c = F,
  prop.t = F, prop.chisq = F)