View source: R/rast_to_netcdf.R
rast_to_netcdf | R Documentation |
Conversion of SpatRaster to array and optionally save on a Netcdf File.
rast_to_netcdf(r, file, name, unit = units(r), XY = FALSE, verbose = TRUE)
r |
SpatRaster object |
file |
Netcdf file name |
name |
variable name on a Netcdf file |
unit |
unit of the variable (set to NA to don't change unit) |
XY |
set to true if MemoryOrder is XY (only if file is missing) |
verbose |
display additional information |
numerical array
eva3dm::wrf_rast support 3d SpatRaster, in case of a 4d variable use other approach to save on file.
folder <- system.file("extdata",package="eva3dm")
wrf_file <- paste0(folder,"/wrf.day1.o3.nc")
Rast <- wrf_rast(wrf_file,'o3')
A <- rast_to_netcdf(Rast)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.