Population Density of India
To make stylistic maps from any raster data input in reproducible and understandable code
This repo has been expanded to other types of elevation and population density maps. The code reflects both line graphs and other types of simple elevation maps.
All work is done with R statistical software
- Basic familiartity with spatial data and data structures
- Raster data of something
- Shapefile of area of interest
- R software
library(dplyr) # data manipulation
library(raster) # read raster data
library(ggplot2) # graphing
library(sf) # read polygons
library(ggridges) # achieves ridges look to data
library(grid) # extra background plotting function
library(RColorBrewer) # not needed but nice to play with
This script can be used to make a map similar to the one above with any input raster. Added functionality to make a gradient raster in the background.
Population density used to make the India map can be found here:
A good resource for shapefiles is Natural Earth
This workflow is inspired by a blogs postsI found while researching the excellent velox package.
This lead me to another useful blog post about line maps.
The ggridges library was also very useful as it cleans up the workflow and plotting functionality considerably.