[R] xyTable(x,y) versus table(x,y) with NAs

Viechtbauer Wolfgang (SP) wolfgang.viechtbauer at maastrichtuniversity.nl
Tue Dec 12 23:24:41 CET 2017


Hi All,

It seems to me that xyTable() gets thrown off by NAs:

x <- c(1, 1, 2, 2,  2, 3)
y <- c(1, 2, 1, 3, NA, 3)
table(x, y, useNA="always")
xyTable(x, y)

Is this intended behavior?

Best,
Wolfgang



More information about the R-help mailing list