Description Usage Arguments Details Value Note Author(s) References See Also Examples
A dot-density map is one way to map aggregated spatial data without some of the distortions inherent in choropleths.
1 2 3 4 |
map |
Object gadm_sf |
data |
data.frame - data to plot |
values |
String - the names of the columns in the data.frame we want to plot. (eg: number of cases) |
cases.by.dots |
integer of breaks values |
dot.size |
numericr - size of dots. Default = 0.25. |
adm.join |
String - the name in your dataset joined with the field NAME_X of the map, where X is the level of the administrative boundaries. For instance if the level is about 'Districts' of a country, and your dataset has a field named "Study_Location" containing a list of districts, just do adm.join = "Study_Location". |
labels |
String vector labels for the legend. Default NULL. If NULL values are used as labels |
palette |
String - An RColorBrewer palette name or a String vector vector of colors. Default NULL. |
title |
String - title of the plot. Default is NULL |
subtitle |
String - subtitle of the plot. Default is NULL. |
caption |
String - caption of the plot. Default is NULL. |
—-
Object ggplot2
dotDensity only works with maps loaded with gadm_sf_loadCountries
Jean Pierre Decorps <jp.decorps@epiconcept.fr>
https://en.wikipedia.org/wiki/Dot_distribution_map
classIntervals
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | library(GADMTools)
data("Corsica")
# Creates test data.frame (fake data) --------------------------------------
# --------------------------------------------------------------------------
VAR_1 <- as.integer(runif(n = 43, min = 800, max = 15800))
VAR_2 <- as.integer(runif(n = 43, min = 1000, max = 15800))
VAR_3 <- as.integer(runif(n = 43, min = 1500, max = 15800))
Cantons <- listNames(Corsica, 4)
DF <- data.frame(Cantons, VAR_1, VAR_2, VAR_3, stringsAsFactors = FALSE)
dotDensity(Corsica,
DF,
adm.join="Cantons",
values = c("VAR_1", "VAR_2", "VAR_3"),
labels = c("H1N1", "H1N2", "H2N2"),
palette = c("#ffff00", "#ffaa00", "#FF3200"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.