Description Usage Arguments Examples
View source: R/hexbin_raster.R
This function allows you to create a hexbin plot of a rasterLayer.
1 | hexbin_raster(r, n, fun)
|
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. |
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))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.