# NOT RUN {
T1 <- xtabs(~type, data = Weather94)
T1
par(mar = c(5.1 + 2, 4.1 - 1, 4.1 - 2, 2.1))
barplot(sort(T1, decreasing = TRUE), las = 2, col = rainbow(11))
par(mar = c(5.1, 4.1, 4.1, 2.1))
# }
# NOT RUN {
library(ggplot2)
T2 <- as.data.frame(T1)
T2
ggplot2::ggplot(data =T2, aes(x = reorder(type, Freq), y = Freq)) +
geom_bar(stat = "identity", fill = "purple") +
theme_bw() +
theme(axis.text.x = element_text(angle = 55, vjust = 0.5)) +
labs(x = "", y = "count")
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab