I have downloaded multiple monthly mean GRIB files from https://cds.climate.copernicus.eu/cdsapp#!/dataset/ecv-for-climate-change?tab=form for Surface Air temperature , from 1979 to 1990. 144 GRIB files have been saved in my working directory. I know how to read one GRIB FILE (this is of 1979 JAN):
#setting working directory setwd("C:/Users/Halima Usman/Documents/ICIMOD") #reading grib files pre1=raster('1month_mean_Global_ea_2t_197901_v02.grib',package="raster") test=brick(pre1) raster1=stack(test) plot(raster1) #january 1979
Now, I would like to know how to read all the 144 files in one go and create a single stack of all those GRIB files and take a mean.