Keeping raster variable names when converting to NetCDF using R
问题 Taking a raster file of monthly temperature data for multiple years which has a name attached accessible via names(object) in the following format 'Jan.1981', 'Feb.1981' etc (example files for two years that works with code below here - adding all files makes it too big. Reading in and writing this to NetCDF using the following code: #Load Packages library(raster) library(ncdf4) #Read in temperature files r1 <- brick('TavgM_1981.grd') r2 <- brick('TavgM_1982.grd') #stack them together