rasterize_dets: Rasterize acoustic detections

Description Usage Arguments Details Value Examples

View source: R/s4_grids.R

Description

This function takes either detections at stations or centers of activity (COAs) and creates a raster map showing number of detections in each cell.

Usage

1
rasterize_dets(det_locs, r = init_raster(sta = det_locs))

Arguments

det_locs

A data.frame of georeferenced acoustic detections. Could be, e.g., the data.frame returned by proc_dets() or the data.frame returned by coa_locs()

r

A blank raster to use as the template for rasterizing the locations. Defaults to a call to init_rast() with det_locs passed as the argument sta

Details

Calls the function raster::rasterize() to generate the raster. Uses the function 'count'

Value

Returns an object of class RasterLayer with values equal to the number of detections in each raster cell.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#Load example data
data(acoustic)

#Process detections
proc.det <- proc_dets(det = acoustic$detections, sta = acoustic$stations)

#Default rasterize
r1 <- rasterize_dets(det_locs = proc.det)

#Plot
plot(r1)
plot(acoustic$land, add = TRUE, col="wheat")

#Rasterize with a smaller grid
r2 <- rasterize_dets(det_locs = proc.det,
                     r = init_raster(sta = proc.det, res = 0.001))

#Plot
plot(r2)
plot(acoustic$land, add = TRUE, col="wheat")

#Rasterize COAs
coas <- coa_locs(proc.det)
r3 <- rasterize_dets(det_locs = coas,
                     r = init_raster(sta = proc.det, res = 0.001))

#Plot
plot(r3)
plot(acoustic$land, add = TRUE, col="wheat")

bsmity13/ADePTR documentation built on Nov. 9, 2019, 12:43 a.m.