Description Usage Arguments Details Value Examples
This function can take one of user-defined x- and y-limits, station locations, or a study area polygon and create an empty raster to use in the detection summary figures.
1 2 3 |
xlim |
A numeric vector of length 2 giving user-defined x-limits. If
|
ylim |
A numeric vector of length 2 giving user-defined y-limits. If
|
sta |
A data.frame with x- and y-coordinates of all the stations
in the study area. The x- and y-coordinates should be in columns named
|
study_area |
A polygon of class |
res |
A numeric vector of length 1 or 2 giving the size of a grid
cell in units of the coordinate reference system. See
|
crs |
A character or object of class CRS. Defines the coordinate
reference system to use for the resulting raster. Should match the CRS of
the input if applicable. Used by |
Behavior depends upon the input. Once the function reaches a valid input, it returns the raster without bothering to check if additional inputs were provided.
The order it checks in is:
xlim and ylim (must provide both)
sta (x- and y-coordinates should be named "x" and
"y")
study_area (polygon of class sfc)
Returns an object of class
RasterLayer
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | #Load sample data
data(acoustic)
#Using xlim and ylim
xlim <- c(-64.628, -64.612)
ylim <- c(17.770, 17.795)
r.lim <- init_raster(xlim = xlim, ylim = ylim)
#Use UTM
xlim <- c(321160, 335010)
ylim <- c(1965700, 1973810)
r.lim.utm <- init_raster(xlim = xlim, ylim = ylim,
res = 500, #units here are meters
crs = sp::CRS("+init=epsg:32620"))
#Using sta
r.sta <- init_raster(sta = acoustic$stations)
#Using study_area
r.sa <- init_raster(study_area = acoustic$study_area)
#Change the resolution (in CRS units)
r.sa2 <- init_raster(study_area = acoustic$study_area,
res = 0.0001)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.