colmap: Colmap

Description Usage Arguments Value Examples

Description

colmap - for colombian map (or in general color map) - is a wrapper of ggplot and its geom_map so that its easy to make a quick choropleth map. You can get further control with ggplot.

Usage

1
2
colmap(map = departamentos, data = NULL, var = NULL, map_id = "id",
  data_id = map_id, legend = TRUE, autocomplete = FALSE)

Arguments

map

a fortifyable object sucha as a SpatialPolygonsDataFrame resulting in a data.frame with columns x or long, y or lat and region or id.

data

a data.frame that contains an id variable to match the map regions and the variable to plot over the map. By default no data is needed in which case only the map is represented coloring the regions with ggplot's default pallete.

var

character, the name of the variable in data to be represented in the map. By default it will take the first non id variable.

map_id

character, name of the map id variable. By default "id" which is how the region id is set on the spatial objects through fortify.

data_id

character, name of the data variable to match the map id.

legend

logical, include legend (color guide) in the plot? No legend is included if only the map is ploted.

autocomplete

logical, if there are any map regions without corresponding data values and autocomplete is true then the data will be auto-completed with missing values to plot all the regions instead of having void portions in the map.

Value

a ggplot object.

Examples

1
colmap() # Plot default map: Colombia departments.

nebulae-co/colmaps documentation built on May 23, 2019, 1:30 p.m.