Reputation: 43560
I have a table produced by calling table(...) on a column of data, and I get a table that looks like:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
346 351 341 333 345 415 421 425 429 437 436 469 379 424 387 419 392 396 381 421
I'd like to draw a boxplot of these frequencies, but calling boxplot on the table results in an error:
Error in Axis.table(x = c(333, 368.5, 409.5, 427, 469), side = 2) :
only for 1-D table
I've tried coercing the table to an array with as.array
but it seems to make no difference. What am I doing wrong?
Upvotes: 2
Views: 5687
Reputation: 226087
If I understand you correctly, boxplot(c(tab))
or boxplot(as.vector(tab))
should work (credit to @joran as well).
Upvotes: 4