Weekly visualization: map of conflict in R

Welcome to the weekly post on data visualization! Today I would like to build on the subject I started two weeks ago, when I built a visualization presenting ethnic power relations. Here, I will build a map portraying conflict areas. The dataset I use was prepared by the Uppsala Conflict Data Program, and is available for download from its website. As the dataset is rather large, I will present here only a fraction of it pertaining to India.

I will begin by loading the file into R, and displaying part of its content in graphical form. This is rather easy, as the data contains latitude and longitude of the violence sites. The code below should produce the following output (remember to install the packages if you didn’t have them before!):

This should produce similar output:

Visualization of violence sites in India
Visualization of violence

The output is quite legible, even without country borders added. We can see the sites of majority of violent incidents, which are Kashmir, North East, and the Maoist Red Corridor along the Eastern Coast. The other incident sites seem to be rather random, with some concentration in the region of Gujarat. The division of types of violence, marked by shape of the objects, is not visible due to large amount of incidents. In practice, it would be quite clear, as we would probably rather use data pertaining to a single year, and properly scaled.

But in order to use it, we need to mark country borders. This, fortunately, is quite easy with inbuilt libraries. Try the following code:

This produced the following visualization:

Map of violent incidents in India
Map of violent incidents in India

The visualization is rather clear now. We can still see the accumulation of incident marks being hardly legible, but that is dependent on the scale of the map, and can be reduced by limiting the time period of the data. The shape of marks depends on the type of violence (the ‘1’ being state-based conflict, ‘2’—non-state conflict, and ‘3’—one-sided violence). The size of marks depends on the estimated number of casualties. I add the ‘coord_fixed’ clause following Eric Anderson, as it gives the map a proper scale. You could further experiment with limiting data to one particular year, or group of years, like in the following snippet, which would display incidents which took place after the year 2012. A good idea would be to check different alpha settings—here I set it to 0.3, which gives more clarity to the map:

Violent incidents in India after 2012
Violent incidents in India after 2012

What is interesting is that the scale of violence is now adjusted to the new snippet of data. In the previous visualization, the estimate of fatalities reached the number 2,000. In the new snippet of data, the maximum number of fatalities was much lower, which is visible also in the legend to the map. You should pay particular attention to it when displaying several maps alongside one another, as it could potentially introduce much confusion into analysis of the data.

Leave a Reply