Learn R Programming

isocat (version 0.3.0)

makeQuantileSurfaces: 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)

Value

Returns RasterLayer rescaled to quantile values.

Arguments

probabilitySurface

Normalized probability surface RasterLayer

rename

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

See Also

quantileAtSamplingLocation

Examples

Run this code
# 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)

Run the code above in your browser using DataLab