quantileAtSamplingLocation: Quantile at coordinates function

Description Usage Arguments See Also Examples

View source: R/quantileAtCoordinates.R

Description

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).

Usage

1
quantileAtSamplingLocation(indivraster, Lat, Lon)

Arguments

indivraster

A RasterLayer representing normalized probability of origin surface

Lat

Integer latitude

Lon

Integer longitude

See Also

makeQuantileSurfaces

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
# 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 quantile probability value at specific point.
set.seed(1)
x <- sample( which( !is.na(exampleSurface[]) ), size = 1)
pt <- raster::xyFromCell(exampleSurface, x)
quantileAtSamplingLocation(exampleSurface, Lat = pt[2], Lon = pt[1])

isocat documentation built on July 8, 2020, 5:15 p.m.