Merge multiple NetCDF files into one

mergeNC(files, outfile)

Source

https://github.com/RS-eco/processNC/blob/main/R/mergeNC.R

Arguments

files

character. List of filepaths, which should lead to NetCDF files.

outfile

character. Output filename of the merged data.

Value

A NetCDF file containing all of the merged data.

Examples

if (FALSE) { # \dontrun{
files <- list.files(paste0(system.file(package="processNC"), "/extdata"), 
                    pattern="tas.*\\.nc", full.names=TRUE)
temp <- tempfile(fileext=".nc")
mergeNC(files=files, outfile=temp)
terra::rast(temp) 
} # }