filterNC: Crop NetCDF file

View source: R/filterNC.R

filterNCR Documentation

Crop NetCDF file

Description

Crop NetCDF file

Usage

filterNC(file, startdate, enddate, outfile)

Arguments

file

character. Filepath, which should lead to NetCDF files.

startdate

integer. Start year.

enddate

integer. End year.

outfile

character. Output filename of the croped data.

Value

A NetCDF file containing the croped data.

Examples

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

## End(Not run)

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