Skip to contents

Make dot density points

Usage

dots_points(
  shp,
  cols,
  engine = engine_terra,
  divisor = 250,
  min_point = 0.1 * divisor
)

Arguments

shp

input shp with sf geometry.

cols

<tidy-select> columns to produce dots for.

engine

backend to use. Default is engine_terra.

divisor

Number of people per dot. Default is 250.

min_point

Minimum number of people to generate one dot. Defaults to 10% of the divisor.

Value

tibble with sf geometries

Examples

data('suffolk')
# subset to first 20 rows for speed on CRAN
dots_points(suffolk[1:20, ], c(vap_black))
#> Simple feature collection with 35 features and 2 fields
#> Geometry type: POINT
#> Dimension:     XY
#> Bounding box:  xmin: -7921078 ymin: 5200238 xmax: -7903487 ymax: 5221927
#> Projected CRS: WGS 84 / Pseudo-Mercator
#> First 10 features:
#>    vap_black dots_type                 geometry
#> 1          1 vap_black POINT (-7907649 5221043)
#> 2          2 vap_black POINT (-7909358 5205065)
#> 3          2 vap_black POINT (-7909137 5205020)
#> 4          1 vap_black POINT (-7918143 5204012)
#> 5          1 vap_black POINT (-7915229 5207878)
#> 6          1 vap_black POINT (-7921078 5203911)
#> 7          1 vap_black POINT (-7908443 5204187)
#> 8          1 vap_black POINT (-7911902 5214244)
#> 9          1 vap_black POINT (-7907793 5219046)
#> 10         3 vap_black POINT (-7913828 5208537)