multiplot: A Wrapper for the areamap function

Description Usage Arguments Details

View source: R/multiplot.R

Description

Creates multiple choropleth maps for areal data using ggplot2.

Usage

1
multiplot(shapefile = shapefile, adata = data, maptitle = c("Map Title"), guidetitle = c("Guide Title"), lower = NULL, upper = NULL, nrow = NULL, ncol = NULL)

Arguments

shapefile

A shapefile for the study region. It will be used for all the maps.

adata

A dataframe for the areal data. The data can be numeric or factor.

maptitle

A vector of map titles. It must have the same length as the number of maps created.

guidetitle

A vector of guide titles. It must have the same length as the number of maps created.

lower

The lower limit used in the guide for continuous data.

upper

The upper limit used in the guide for continuous data.

nrow

The number of rows in the final grid.

ncol

The number of columns in the final grid.

Details

This is a wrapper for the areamap function, it will generate a gridExtra grid containing up to four maps. This function will run the areamap for each of the maps.

The data must be organized the same way as if creating a single map. The data in each variable must be in the same order of the shapefile's polygons and must have the same length.

The title of the maps and of the guides must be entered in a vector, they will be used in the order they are entered.

If a lower and upper limit are entered in the function they will be used for all the maps that uses continuous data. Since this function will likely be used to plot maps for the data across different times, it's a good practice to standardize the guide's scale. In case the lower and upper limits are not specified, the areamap function will use the minimum and maximum values found in the data, which will result in different scales for each map.


qspatialR/qspatial documentation built on April 30, 2020, 6:55 a.m.