read_nc | R Documentation |
Read and tidy your initial NetCDF by turning the absolute values into monthly-based anomalies, and by subsetting the time series and geogprahical area of your atmospheric variable.
read_nc(
x,
level = NULL,
anomaly = F,
time_subset = NULL,
month_subset = NULL,
crop_area = NULL,
aggregate = NULL
)
x |
path to file or SpatRaster object. |
level |
integer. Default NULL. Select a specific pressure level if the data contains multiple levels. |
anomaly |
logical. If TRUE it convets into anomalies, based on their corresponding monthly means. |
time_subset |
character or Date. Default NULL. Provide a vector of dates to subset the original SpatRaster time series. |
month_subset |
integer. Default NULL. Provide a vector of integers to subset the original SpatRaster by months. |
crop_area |
integer. Default NULL. Provide a vector of coordinates (xmin,xmax,ymin,ymax) to crop the original SpatRaster domain. |
aggregate |
integer. Default NULL. Resampling to a coarser resolution. Useful to save memory when processing heavy time-consuming datasets. |
A SpatRaster object. It must be converted to daily if the input is hourly.
read_nc
# Load data (mslp or precp_grid)
slp_file <- system.file("extdata", "mslp_ei.nc", package = "synoptReg")
# Reading data simply
slp <- read_nc(slp_file)
# Converting to monthly based anomalies and just for October, November and December
slp <- read_nc(slp_file, anomaly = TRUE, month_subset = 10:12)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.