collate: Collate dsmartr iterations

View source: R/dsmartr_collate.R

collateR Documentation

Collate dsmartr iterations

Description

Processes the outputs of iterate

Usage

collate(iteration_stack = NULL, lookup = NULL, cpus = 1)

Arguments

iteration_stack

RasterStack or Brick; output iteration_maps from iterate.

lookup

Data Frame; contains raster values and corresponding soil class labels. Example:

'data.frame':    38 obs. of  2 variables:
$ VALUE: int  1 2 3 4 5 6 7 8 9 10 ...
$ CLASS: chr  "Ad" "An" "Bb" "Bh" ...
cpus

Integer; number of processors to use in parallel.

Value

A list of four RasterStacks:

  • dsmartr_predictions: RasterStack, soil class prediction maps in order of most to least-probable

  • dsmartr_probabilties: RasterStack, a probability surface for each layer of dsmartr_predictions.

  • tallied_predictions: RasterStack containing per-pixel tallies of soil class occurrence.

  • tallied_probabilities: RasterStack containing per-pixel probabilities of soil class occurrence.

All outputs are written to disk as multiband GeoTIFFs before being assigned to the global environment.

Note

This function can generate very large R temporary files. A rough minimum disk space requirement is n iterations * n covariate cells * 8 bytes * 2.

Examples

## Not run: 
# run iterate() with the example data, then:
LUT <- levels(iteration_maps[[1]])[[1]]
collated <- collate(iteration_stack = iteration_maps, lookup = LUT,
 cpus = max(1, (parallel::detectCores() - 1)))
 
## End(Not run)

obrl-soil/dsmartr documentation built on Feb. 1, 2024, 10:57 p.m.