Code Examples

Below, we provide a number of examples for using data from the MMAD in a research project. All examples require the freely available R statistical software and the extension packages indicated in the code.

The code examples are not complete in the sense that they can directly be executed. Rather, they require some familiarity with R. In particular, users need to set up their working environment themselves and configure R accordingly (for example, set the working directory).

Working with the Report-level Dataset

This example shows how to aggregate the original report-level data in the MMAD to the event level (which is required for most analyses).

Working with the Event-level Dataset

This example shows how to plot a simple map of protest events.