wpRasterStackCalc: wpRasterStackCalc function to calculate the values for a new...

Description Usage Arguments Value Examples

Description

wpRasterStackCalc function to calculate the values for a new Raster object from other RasterStack object using a formula. Function is paralyzed and suitable for big rasters

Usage

1
2
3
wpRasterStackCalc(x, fun = "mean", filename = rasterTmpFile(),
  NAflag = NULL, datatype = NULL, overwrite = TRUE, cores = NULL,
  minblk = NULL, cblk = NULL, silent = TRUE, na.rm)

Arguments

x

RasterStack object

fun

is typically a function that can take a single vector as input

filename

File of a new raster file.

NAflag

NO data value will be used for a new raster

datatype

Type of raster. Avalible are INT1S/INT2S/INT4S/FLT4S/LOG1S/INT1U/INT2U/INT4U/FLT8S

overwrite

Overwrite existing file

cores

Integer. Number of cores for parallel calculation

minblk

Integer. Minimum number of blocks. If NULL then it will be calculated automaticly

cblk

Integer. param to controle min number of blocks during paralisation

silent

If FALSE then the progress will be shown

na.rm

Optional

Value

Raster* object

Examples

1
2
3
4
5
wpRasterStackCalc( x, fun='sum')
wpRasterStackCalc( x, fun=function(x){ sum(as.numeric(x))})
wpRasterStackCalc( x, fun=function(x){ (x[1]-x[2])/x[3]})
wpRasterStackCalc( x, fun=function(x){ if (any(!is.na(x))) { return(0) } else { return(NA) }}
			

wpgp/wpUtilities documentation built on May 29, 2019, 11:58 a.m.