# NOT RUN {
par(las = 2, mfrow = c(2, 2))
stripchart(number ~ country, data = Diplomat, pch = 19,
col= "red", vertical = TRUE)
stripchart(rate ~ country, data = Diplomat, pch = 19,
col= "blue", vertical = TRUE)
with(data = Diplomat,
barplot(number, names.arg = country, col = "red"))
with(data = Diplomat,
barplot(rate, names.arg = country, col = "blue"))
par(las = 1, mfrow = c(1, 1))
# }
# NOT RUN {
library(ggplot2)
ggplot2::ggplot(data = Diplomat, aes(x = reorder(country, number),
y = number)) +
geom_bar(stat = "identity", fill = "pink", color = "black") +
theme_bw() + labs(x = "", y = "Total Number of Tickets")
ggplot2::ggplot(data = Diplomat, aes(x = reorder(country, rate),
y = rate)) +
geom_bar(stat = "identity", fill = "pink", color = "black") +
theme_bw() + labs(x = "", y = "Tickets per vehicle per month")
# }
Run the code above in your browser using DataLab