create_base_plot_cat: Create a categorical choropleth

Description Usage Arguments Value

Description

Create a categorical choropleth

Usage

1
2
3
4
5
6
7
8
9
create_base_plot_cat(
  choropleth_data,
  color_palette,
  na_color,
  drop_levels,
  iceland,
  are_there_missings,
  unit_text
)

Arguments

choropleth_data

An sf object with the categorical data in column cat.

color_palette

A named character vector with colors. If you use this with categorical variables, make sure that the color_palette has a value for each categories except for missing values, and it is named to the category name (factor level) as it is found in you values_var.

na_color

Defaults to "grey93". This color will be used in the color palette for missing values, unless you have explicitly set one of the names of the palette to "missing".

drop_levels

Weather to drop categorical levels on the choropleth if they are not present in the data. Defaults to FALSE.

iceland

A logical variable to show Iceland on the map.

are_there_missings

A logical variable if missing data is present.

unit_text

Defaults to NULL. The title caption of the color (fill) legend.

Value

A ggplot object containing the choropleth map.


antaldaniel/satellitereport documentation built on Aug. 7, 2020, 8:37 a.m.