simmatrixMaker: Generates similarity matrix for RasterStack

Description Usage Arguments Examples

View source: R/simmatrixMaker.R

Description

Applies pairwise comparisons of Schoener's D-metric between each RasterLayer in a RasterStack to populate a similarity matrix.

Usage

1
simmatrixMaker(assignmentRasters, nClusters = FALSE, csvSavePath = FALSE)

Arguments

assignmentRasters

Input RasterStack

nClusters

Clusters to create run in parallel using 'doParallel'. Defaults to FALSE.

csvSavePath

Optional savepath to write similarity matrix to csv file. Defaults to FALSE, will not create csv.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Create probability-of-origin maps to compare.
myiso <- rasterFromXYZ(isoscape)
raster::plot(myiso)
myiso_sd <- rasterFromXYZ(isoscape_sd)
n <- 5
set.seed(42)
df <- data.frame(
         ID = LETTERS[1:n],
         isotopeValue = sample(-120:-40, n),
         SD_indv = rep(5, n)
         )
assignmentModels <- isotopeAssignmentModel(
                        ID = df$ID,
                        isotopeValue = df$isotopeValue,
                        SD_indv = df$SD_indv,
                        precip_raster = myiso,
                        precip_SD_raster = myiso_sd,
                        nClusters = FALSE
                        )
raster::plot(assignmentModels)
# Compare maps with simmatrixMaker.
simmatrixMaker(assignmentModels, nClusters = FALSE, csvSavePath = FALSE)

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