hexbin_points: The hexbin_points function

Description Usage Arguments Examples

View source: R/hexbin_points.R

Description

This function allows you to create a hexbin plot from point data.

Usage

1
hexbin_points(points, n, fun, z, buffer = 0.1, return.na = FALSE)

Arguments

points

The sfc points object to summarize

n

The approximate number of hexbin cells

fun

The function to apply when summarizing point values in each hexbin cell

z

The column of the SF points object to apply the function to

buffer

The distance by which to buffer the convex hull of points used to create the hexbin cells as a proportion of the maximum interpoint distance. By default set to 0.1 (10%)

return.na

Logical. Whether or not to return hexbin cells with NAs.

Examples

1
2
3
4
5
6
7
8
# Load BCG vaccination data
data("BCG_vaccination_DRC")

# Get mean coverage per hexbin
hexbin_points(BCG_vaccination_DRC, n = 250, fun = mean, z = "coverage")

# Get number of points per hexbin
hexbin_points(BCG_vaccination_DRC, n = 250, fun = length, z = "coverage")

disarm-platform/MapPalettes documentation built on Jan. 11, 2020, 5:51 p.m.