T1 <- xtabs(~ station + passed, data = Inspect)
T1
barplot(T1, beside = TRUE, legend = TRUE)
chisq.test(T1)
rm(T1)
if (FALSE) {
library(ggplot2)
ggplot2::ggplot(data = Inspect, aes(x = passed, fill = station)) +
geom_bar(position = "dodge") +
theme_bw()
}
Run the code above in your browser using DataLab