Learn R Programming

dots

dots provides tools to make dot density maps.

Installation

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.9.1, GDAL 3.4.3, PROJ 7.2.1; sf_use_s2() is TRUE
library(ggplot2)
data('suffolk')
dots::dots(suffolk, c(pop_black, pop_white), divisor = 1000) + 
  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) |> 
  ggplot() + 
  geom_sf(data = suffolk) + 
  geom_sf(aes(color = dots_type)) + 
  scale_color_viridis_d() + 
  theme_void()

Copy Link

Version

Install

install.packages('dots')

Monthly Downloads

196

Version

0.0.2

License

MIT + file LICENSE

Issues

Pull Requests

Stars

Forks

Last Published

July 15th, 2022

Functions in dots (0.0.2)

dots_points

Make dot density points
engine_terra

Generate Points with terra
engine_sp_stratified

Generate Stratified Points with sp
filter_pts

Filter Points to a Region
%>%

Pipe operator
engine_sp_regular

Generate Regular Points with sp
engine_sp_random

Generate Random Points with sp
suffolk

Suffolk County, MA Voting Districts
dots

Make dot density plots
engine_sp_nonaligned

Generate Nonaligned Points with sp
engine_sf_hexagonal

Generate Hexagonal Points with sf
clip_water

Remove Water
engine_sf_random

Generate Random Points with sf
engine_sf_regular

Generate Regular Points with sf
engine_sp_hexagonal

Generate Hexagonal Points with sp
boston_water

Boston Water
engine_sp_clustered

Generate Clustered Points with sp