Dot Density Maps

Generate point data for representing people within spatial data. This collects a suite of tools for creating simple dot density maps. Several functions from different spatial packages are standardized to take the same arguments so that they can be easily substituted for each other.


dots

R-CMD-check dots statusbadge Lifecycle:stable CRANstatus CRAN downloads

dots provides tools to make dot density maps.

Installation

You can install the stable version of dots from CRAN with:

install.packages('dots')

You can install the development version of dots from GitHub with:

remotes::install_github('christopherkenny/dots')

Example

The main function in dots is dots().

library(dots)
library(sf)
#> Linking to GEOS 3.13.1, GDAL 3.11.0, PROJ 9.6.0; sf_use_s2() is TRUE
library(ggplot2)
data('suffolk')
dots::dots(suffolk, c(pop_black, pop_white), divisor = 1000, engine = engine_sf_random) + 
  scale_color_viridis_d() + 
  theme_void()

You can also use dots_points() to only make the randomized points.

dots::dots_points(suffolk, c(pop_black, pop_white), divisor = 1000, engine = engine_sf_random) |> 
  ggplot() + 
  geom_sf(data = suffolk) + 
  geom_sf(aes(color = dots_type)) + 
  scale_color_viridis_d() + 
  theme_void()

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("dots")

0.0.3 by Christopher T. Kenny, a year ago


https://github.com/christopherkenny/dots, http://christophertkenny.com/dots/


Report a bug at https://github.com/christopherkenny/dots/issues


Browse source code at https://github.com/cran/dots


Authors: Christopher T. Kenny [aut, cre] (ORCID:


Documentation:   PDF Manual  


MIT + file LICENSE license


Imports ggplot2, rlang, rmapshaper, sf, terra, purrr, dplyr, sp

Suggests knitr, rmarkdown, testthat, wacolors


See at CRAN