27 november 2017

The Bombardment of Rotterdam

The data used for this assignment contains information regarding bomb strikes in Rotterdam between 1940 and 1945. Specifically, the original data reports bomb strike impact locations, furher details regarding the strike and the data on which the strike occured.

This data is used to compute aggregates per month, which are then plotted using plotly. The resulting plot can be found on the next slide, whereas the code used to generate it is found on the subsequent slide.

Plot of bombardments

Code used to generate the plot

# Define margins of plot
m <- list(
      l = 50,
      r = 50,
      b = 150,
      t = 50,
      pad = 4
)

# Annotate and arrange x- and y-axis
y <- list(title="Total amount of bomb strikes", titlefont="f")
x <- list(title="", categoryorder="array", categoryarray=~YearMonth)

# Generate the plot
plot_ly(ym, x=~YearMonth, y=~Bombstrikes, 
        color=I(rep(colorRampPalette(c("lightgreen", "orange",
                                       "tan4", "darkgrey"))(12), 6))) %>%
      add_bars() %>%
      layout(yaxis=y, xaxis=x, margin=m,
             title="Bomb strikes in Rotterdam, 1940-1945")