This function processes NARR2 data based on the specified parameters.
Usage
process_narr2(
date = c("2023-09-01", "2023-09-01"),
variable = NULL,
path = NULL,
...
)
Details
This function performs the following steps:
Sets up the directory path.
Checks for null parameters.
Identifies file paths based on the specified variable.
Generates a date sequence based on the specified start and end dates.
Filters the file paths to include only dates of interest.
Sets up the search abbreviation and target variable.
Imports and processes the data for each file path.
Subsets the data to include only dates of interest.
Returns the processed data as a SpatRaster object.
Examples
# Process NARR2 data for the variable "PRATE" from
# September 1, 2023 to September 1, 2023
if (FALSE) { # \dontrun{
data <-
process_narr2(
date = c("2023-09-01", "2023-09-01"),
variable = "PRATE",
path = "/path/to/data"
)
} # }