makeQuantileSurfaces: Convert probability surface to probability-quantile surface

View source: R/makeQuantileSurface.R

makeQuantileSurfacesR Documentation

Convert probability surface to probability-quantile surface

Description

Converts normalized probability surface (e.g. one layer output of isotopeAssignmentModel function) to quantile surfaces.

Usage

makeQuantileSurfaces(probabilitySurface, rename = FALSE)

Arguments

probabilitySurface

Normalized probability surface RasterLayer

rename

Character value to append to raster name (e.g. "_quantile"). Defaults to FALSE.

Value

Returns RasterLayer rescaled to quantile values.

See Also

quantileAtSamplingLocation

Examples

# Generate example probability surfaces.
myiso <- rasterFromXYZ(isoscape)
myiso_sd <- rasterFromXYZ(isoscape_sd)
df <- data.frame(
         ID = c(-100, -80, -50),
         isotopeValue = c(-100, -80, -50),
         SD_indv = rep(5, 3)
         )
assignmentModels <- isotopeAssignmentModel(
         ID = df$ID,
         isotopeValue = df$isotopeValue,
         SD_indv = df$SD_indv,
         precip_raster = myiso,
         precip_SD_raster = myiso_sd,
         nClusters = FALSE
         )

# Convert to quantile surfaces.
quantile_surface <-  raster::stack( lapply( unstack(assignmentModels), makeQuantileSurfaces) )
plot(quantile_surface)


cjcampbell/IsoModAT documentation built on Feb. 21, 2024, 10:27 a.m.