Description Usage Arguments Examples
View source: R/hexbin_points.R
This function allows you to create a hexbin plot from point data.
1 | hexbin_points(points, n, fun, z, buffer = 0.1, return.na = FALSE)
|
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. |
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")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.