Learn R Programming

ech (version 0.1.0)

plot_geouy: plot_geouy

Description

This function allows you to set ggplot2 theme in our suggested format.

Usage

plot_geouy(x, col, viri_opt = "plasma", l = NULL, other_lab = NULL, ...)

Arguments

x

An sf object like load_geouy() results

col

Variable of "x" to plot (character)

viri_opt

A character string indicating the colormap option to use. Four options are available: "magma" (or "A"), "inferno" (or "B"), "plasma" (or "C"), "viridis" (or "D", the default option) and "cividis" (or "E")

l

If NULL none label added, if "%" porcentage with 1 decimal labels, if "n" the value is the label, if "c" put other variable in other_lab. Default NULL

other_lab

If l is "c" put here the variable name for the labels.

...

All parameters allowed from ggplot2 themes.

Value

ggplot object of a choropleth map with x geometries and col values.

See Also

Other geo: add_geom()

Examples

Run this code
# NOT RUN {
pobre_x_dpto <- get_estimation_mean(data = ech::toy_ech_2018, variable = "pobre06",
                                    by.x = "nomdpto", level = "h", name = "Pobreza")
pobre_x_dpto <- pobre_x_dpto %>% dplyr::filter(pobre06 == "Pobre")
pobre_x_dpto_geo <- add_geom(data = pobre_x_dpto, unit = "Departamentos", variable = "nomdpto")
plot_geouy(x = pobre_x_dpto_geo, col = "Pobreza", l = "%")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab