% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/aggregateNC.R
\name{aggregateNC}
\alias{aggregateNC}
\title{Aggregate one or multiple NetCDF Files over time and/or space}
\usage{
aggregateNC(infile, outfile, var, startdate, enddate, group_col = "year")
}
\arguments{
\item{infile}{\code{character}. A filepath or list of filepaths. Filepath should lead to a NetCDF file.}

\item{outfile}{\code{character}. Output filename of the averaged data.}

\item{var}{\code{character}. Variable which is used, one of tas, tasmin, tasmax and pr.}

\item{startdate}{\code{integer}. Start year.}

\item{enddate}{\code{integer}. End year.}

\item{group_col}{\code{character}. One of year, yearmon, month}
}
\value{
A NetCDF with temporal values averaged over the specified area.
}
\description{
Aggregate one or multiple NetCDF Files over time and/or space
}
\examples{
\dontrun{
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)
}
}
