View source: R/oddsAtCoordinates.R
oddsAtSamplingLocation | R Documentation |
Function estimates percentile of each non-NA value within a RasterLayer using the empirical cumulative distribution function, and extracts value at location specified. For more information, see help(ecdf).
oddsAtSamplingLocation(indivraster, Lat, Lon)
indivraster |
RasterLayer representing normalized probability of origin surface |
Lat |
Integer latitude |
Lon |
Integer longitude |
makeOddsSurfaces
# Generate example probability surface.
myiso <- raster::rasterFromXYZ(isoscape)
myiso_sd <- rasterFromXYZ(isoscape_sd)
exampleSurface <- isotopeAssignmentModel(
ID = "A",
isotopeValue = -100,
SD_indv = 5,
precip_raster = myiso,
precip_SD_raster = myiso_sd,
nClusters = FALSE
)
# Calculate odds ratio at specific point.
set.seed(1)
x <- sample( which( !is.na(exampleSurface[]) ), size = 1)
pt <- raster::xyFromCell(exampleSurface, x)
oddsAtSamplingLocation(exampleSurface, Lat = pt[2], Lon = pt[1])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.