Mass shootings dataset

by Sofia

First small barplot on the mass shootings dataset. Frustrated that I don’t know why the Saturday label won’t appear.

barplot1

# obtaining counts for shootings per day
cur15$day Friday Monday Saturday Sunday Thursday Tuesday Wednesday
35 31 72 68 28 31 31

# creating dataframe
weekday = c(“Sunday”, “Monday”, “Tuesday”, “Wednesday”, “Thursday”, “Friday”, “Saturday”)
count = c(68, 31, 31, 31, 28, 35, 72)
wkday.count = data.frame(weekday, count)

# barplot, days not in alphabetical order
library(ggplot2)
wkday.count$weekday ggplot(wkday.count, aes(wkday.count$weekday, y= wkday.count$count)) +
geom_bar(stat=”identity”, fill = “dark grey”, colour = “black”, alpha = 1/3) +
ggtitle(“Mass shootings in 2015 (as of October 7)”) + xlab(“Day of the week”) +
ylab(“Number of mass shootings”)

Advertisements