# NOT RUN {
T1 <- xtabs(~ fuel + location, data = Heat)
T1
barplot(t(T1), beside = TRUE, legend = TRUE)
# }
# NOT RUN {
library(ggplot2)
ggplot2::ggplot(data = Heat, aes(x = fuel, fill = location)) +
geom_bar(position = "dodge") +
labs(y = "percent") +
theme_bw() +
theme(axis.text.x = element_text(angle = 30, hjust = 1))
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab