create_statistic_raster: Summarize the values of multiple layers into one layer. The...

create_statistic_rasterR Documentation

Summarize the values of multiple layers into one layer. The name of the resulting raster is based on the colnames of the keys data.frame (input) and the values in the first row of this data.frame.

Description

Summarize the values of multiple layers into one layer. The name of the resulting raster is based on the colnames of the keys data.frame (input) and the values in the first row of this data.frame.

Usage

create_statistic_raster(
  x,
  EPSG = "EPSG:28992",
  e = NULL,
  funstr = NULL,
  statistic = "mean",
  keys
)

Arguments

x

filename (character)

EPSG

coordinate reference system like "EPSG:4326" (character)

e

Terra extent object

funstr

Optional function to modify raster values. Denote the raster with 'x' (or character between square brackets) (character)

statistic

Statistic to apply to selected rasters: mean, min, max, sd, median (character)

keys

a one row data.frame (or tibble) with no column, consistently with dplyr::group_keys() (tibble)

Value

terra::SpatRaster

Examples

statistic <- "max"
keys <- data.frame(day=1)
f1 <- system.file("extdata", "HEAD_20080401_l1.idf", package="idf")
f2 <- system.file("extdata", "HEAD_20080501_l1.idf", package="idf")
x <- c(f1, f2)
create_statistic_raster(x, statistic=statistic, keys=keys)

KeesVanImmerzeel/idf documentation built on Jan. 13, 2025, 3:23 a.m.