# NOT RUN {
T1 <- xtabs(~education + parent, data = Parented)
T1
barplot(t(T1), beside = TRUE, legend = TRUE, col = c("blue", "red"))
rm(T1)
# }
# NOT RUN {
library(ggplot2)
ggplot2::ggplot(data = Parented, aes(x = education, fill = parent)) +
geom_bar(position = "dodge") +
theme_bw() +
theme(axis.text.x = element_text(angle = 85, vjust = 0.5)) +
scale_fill_manual(values = c("pink", "blue")) +
labs(x = "", y = "")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab