View source: R/dsmartr_evaluate.R
eval_pgap | R Documentation |
Calculates and maps the difference between the first and second most-probable
dsmartr probability surfaces. Requires outputs of
dsmartr::collate()
.
eval_pgap(dsmartr_probs = NULL, cpus = 1)
dsmartr_probs |
RasterBrick; 'dsmartr_probabilities' output by
|
cpus |
Integer; number of processors to use in parallel. |
probability_gap
: RasterLayer depicting the probability gap.
Written to disk as GeoTIFF.
This function is often called the 'confusion index', but has been renamed as that term is used in multiple contexts within the scientific literature.
## Not run:
# run collate() with the example data then:
pgap1 <-
eval_pgap(dsmartr_probs = collated[['dsmartr_probabilities']][[1:2]],
cpus = max(1, (parallel::detectCores() - 1)))
# or supply unstacked maps after running unstack() (slightly faster)
pgap2 <- eval_pgap(dsmartr_probs = most_likely_soil[c('most_likely_prob_1',
'most_likely_prob_2')],
cpus = max(1, (parallel::detectCores() - 1)))
# or read from file
mpp_1 <- raster(file.path(getwd(), 'most_likely_maps', 'most_likely_1.tif'))
mpp_2 <- raster(file.path(getwd(), 'most_likely_maps', 'most_likely_2.tif'))
pgap3 <- eval_pgap(dsmartr_probs = list(mpp_1, mpp_2),
cpus = max(1, (parallel::detectCores() - 1)))
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.