summariseRast: Aggregate values of multiple NetCDF Files

View source: R/summariseRast.R

summariseRastR Documentation

Aggregate values of multiple NetCDF Files

Description

Aggregate spatio-temporal measurements of one raster stack with daily layers for multiple years to a raster stack with monthly layers

Usage

summariseRast(
  files = files,
  startdate = NA,
  enddate = NA,
  ext = NA,
  var,
  filename1 = "",
  filename2 = "",
  overwrite = FALSE
)

Arguments

files

character. A filepath or list of filepaths. Filepath should lead to a NetCDF file.

startdate

integer. Start year.

enddate

integer. End year.

ext

extent. If present the NetCDF file is subset by this extent.

var

character. Environmental variable provided.

filename1

character. Output filename of the averaged data. If this argument is not provided, result will not be written to disk.

filename2

character. Output filename of the coefficient of variation. If this argument is not provided, the coefficient of variation will not be written to disk.

overwrite

logical. If TRUE, existing files will be overwritten.

Value

A numeric raster stack with monthly layers of aggregated data over specificed time period and area.

Examples

files <- list.files(paste0(system.file(package="processNC"), "/extdata"), 
                    pattern="tas.*\\.nc", full.names=TRUE)
summariseRast(files=files[4], startdate=2001, enddate=2010, var="tas")

RS-eco/processNC documentation built on Aug. 7, 2023, 8:12 a.m.