aggregateNC: Aggregate one or multiple NetCDF Files over time and/or space

View source: R/aggregateNC.R

aggregateNCR Documentation

Aggregate one or multiple NetCDF Files over time and/or space

Description

Aggregate one or multiple NetCDF Files over time and/or space

Usage

aggregateNC(infile, outfile, var, startdate, enddate, group_col = "year")

Arguments

infile

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

outfile

character. Output filename of the averaged data.

var

character. Variable which is used, one of tas, tasmin, tasmax and pr.

startdate

integer. Start year.

enddate

integer. End year.

group_col

character. One of year, yearmon, month

Value

A NetCDF with temporal values averaged over the specified area.

Examples

## Not run: 
file <- list.files(paste0(system.file(package="processNC"), "/extdata"), 
                   pattern="tas.*\\.nc", full.names=TRUE)[4]
temp <- tempfile(fileext=".nc")
aggregateNC(infile=file, outfile=temp, var="tas", startdate="2001", enddate="2010")
terra::rast(temp)

## End(Not run)

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