sampleCoord: Sample pairs of coordinates from a probability raster

Description Usage Arguments Value Examples

Description

This function takes a raster with the detection probabilities around a receiver and samples n number of geografic coordinates according to to the probabilities.

Usage

1
sampleCoord(prob.raster, n = 1)

Arguments

prob.raster

RasterLayer object with the probabilities of being detected by one receiver, as given by the probRaster function.

n

number of pair of coordinates to return.

Value

A data frame with the x and y coordinates of the sampled points, in the same geographic reference system as the prob.rast object.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
library(raster)

# Create the acoustic range model
data(range_test)
det.range <- glm(det.ratio ~ dist.m, data = range_test,
                 family = quasibinomial(logit))

# Probability raster for the receiver 'X1'
rec <- "X1"
prob.rast <- probRaster(dist.rast = viewshed[[rec]], tag.depth = 10,
                        topo = bathymetry, ac.range.mod = det.range)
plot(prob.rast)

# Sample coordinates
sampled.points <- sampleCoord(prob.rast, 10)
points(sampled.points, pch = "+")

aspillaga/fishtrack3d documentation built on June 4, 2019, 9:14 a.m.