Creates a raster density layer from a set of points.
SObin(
x,
y = NULL,
baselayer = NULL,
...,
col = hcl.colors(26, "Viridis"),
dim = c(512, 512),
add = TRUE,
target = NULL,
source = NULL,
data.frame = FALSE
)
longitudes
latitudes
optional spatial layer to get extent from
passed to plot if add = TRUE
colours to use if add = TRUE
dimensions of raster to bin to
if TRUE
, the raster is added to the current plot. An error is thrown if there is no existing plot
target projection passed to SOproj
source projection of data projection passed to SOproj
if true return a data frame instead of a raster.
A raster. If add = TRUE
, it is returned invisibly.
if (FALSE) { # \dontrun{
SOmap_auto()
pts <- cbind(lon = runif(1e6, min = -180, max = 180), lat = runif(1e6, min = -90, max = 90))
bin <- SObin(pts[, 1], pts[, 2], add = TRUE)
} # }