R: Change RasterBrick dimensions from TXY to XYT

المشرف العام

Administrator
طاقم الإدارة
I am having difficulties in R getting climate data from a netCDF file into the right format for further analysis. I am working with gridded global data on Standardized Precipitation Index (downloaded from here and want to aggregate the monthly values for each grid-cells to an annual average.

Now the issue is that in the file the data is organised as TXY, where T are the number of months since January 1960 and X and Y are longitude and latitude respectively. As a result, when I load the file into R with,

library(raster)spi
 
أعلى