Learn R Programming

nimbleSCR (version 0.2.1)

getWindowIndex: Get window index

Description

From a set of windows, find the index of the window into which a given point falls. Can be applied to detection and habitat windows.

Usage

getWindowIndex(curCoords, lowerCoords, upperCoords)

Value

Index of the window where the given point falls; -1 is returned if the point does not fall in any window.

Arguments

curCoords

Vector of coordinates of a single spatial point

lowerCoords, upperCoords

Matrices of lower and upper x- and y-coordinates of a set of windows. One row for each window.

Author

Pierre Dupont

Examples

Run this code

sourceCoords <- c(1.5,2.2)
lowerCoords <- cbind(c(0,1,3,0),c(0,1,2,2))
upperCoords <- cbind(c(1,3,5,3),c(1,2,4,4))
getWindowIndex(sourceCoords, lowerCoords, upperCoords)

Run the code above in your browser using DataLab