# NOT RUN {
library(ggplot2)
# Frequencies
table(lizard_habitat)
# Stacked bar plots
ggplot(lizard_habitat, aes(y = site, fill = sunlight)) +
geom_bar(position = "fill") +
labs(x = "Proportion")
# }
Run the code above in your browser using DataLab