cellstatsNC: Summarise values of one or multiple NetCDF Files over time...

View source: R/cellstatsNC.R

cellstatsNCR Documentation

Summarise values of one or multiple NetCDF Files over time and/or space

Description

Summarise spatial/spatio-temporal measurements of one or multiple NetCDF files to a raster stack or data.frame with desired spatial and temporal resolution

Usage

cellstatsNC(
  files,
  startdate = NA,
  enddate = NA,
  ext = "",
  cores = NA,
  filename = "",
  stat = "mean"
)

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.

cores

integer. Number of cores for parallel computing. If this argument is not provided, at least half the number of availabe cores will be used.

filename

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

stat

character. Currently only works with mean.

Value

A dataframe with temporal values averaged over the specified area.

Examples

files <- list.files(paste0(system.file(package="processNC"), "/extdata"),
                    pattern="tas.*\\.nc", full.names=TRUE)
cellstatsNC(files, startdate=2000, enddate=NA, cores=1)

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