3

I would like to create a bubble chart in R where each bubble represents a mass shooting: casualties Killed and casualties Injuredsomething like the following:

FTData timeline

Basically, I want a ggplot2 bubble chart with geom_point on one horizontal line. Without a y-axis, where the size of the points represent the values (Killed and Injured).

For reproducibility, you can find my dataset of mass shootings in the US (2017) in a shared google spreadsheet. (Do note that the terrible mass shooting in Las Vegas is left out for gradual points size purposes, I will add the one later on).

I created the following plot, but as described I would like to have all the dots (killed and Injured) on one horizontal line.

  data_per_date %>%
  filter(Incident.Date != "2017-10-01") %>% # Las Vegas shooting is left out for size purposes.
  ggplot(aes(x = Incident.Date, y = Killed)) +
  geom_point(aes(size = Injured),
             shape = 21,
             colour = "#FF6F00") + # Should be the orange transparant circles 
  geom_point(aes(size = Killed),
             alpha = 0.7,
             colour = "#B71C1C") # The red bubbles

enter image description here

  • P.s. It's quite a lot to ask, I know, but I can't find any timelines like these created with R. You smart people maybe have some Ideas of how to tackle this problem.
  • P.S. 2 I could align the points in a vector graphic tool like Skech or Illustrator but rather want to know how to do this in R.
Tdebeus
  • 1,519
  • 5
  • 21
  • 43

0 Answers0