## create a binary matrix from the iris data plus a random noise column
x <- apply(iris[,1:4], 2, function(z) z>median(z))
x <- cbind(x, Noise=sample(0:1, 150, replace=TRUE))
## There are significant differences in all 4 original variables, Noise
## has most likely no significant difference (of course the difference
## will be significant in alpha percent of all random samples).
propBarchart(x, iris$Species)
Run the code above in your browser using DataLab