hexbin_raster: The hexbin_raster function

Description Usage Arguments Examples

View source: R/hexbin_raster.R

Description

This function allows you to create a hexbin plot of a rasterLayer.

Usage

1
hexbin_raster(r, n, fun)

Arguments

r

The rasterLayer

n

The approximate number of hexbin cells

fun

The function you want to apply when summarizing raster values in each hexbin. Note that hexbin_raster uses velox which currently does not support na.rm. To ignore NAs pass function which includes na.rm. See examples.

Examples

1
2
3
# Generate hexbins and calculate raster mean in each bin
data("swz_elev")
hexbin_raster(swz_elev, n = 100, function(x) mean(x, na.rm=TRUE))

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