Plotting monthly mean time series of daily .tiff files

0

I have various .tif files named as:

20060103

20060113

20060124

20060203

20060213

20060221

..

..

...

20101224

Files correspond to three dates per each month. Files nomenclature is like yyyymmdd

I want to calculate and plot monthly mean where X axis should represent mean of Jan 2006, Feb 2006, Mar 2006, ......, Dec 2010 and Y axis represents data values

I am able to plot spatial time series for 5 months

using following code:

    ppt<-list.files('C:/Users/shc-user/Desktop/Akanksha/USCRN/Albedo_data/CGLS/Test', full.names = TRUE, pattern = '.*tif')

ppt_stack<-stack(ppt)

ppt_mon<-stackApply(ppt_stack, indices=c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5), fun=mean)

plot(ppt_mon)

The code seems feasible to obtain spatial average for few months. But as I have 20 years of data, I am not able to do it for various months. Also, I want a plot as final output where x-axis represents the months e.g. Jan 2006, Feb 2006...Dec 2010 and y-axis represents data values.

I am trying it in R

This topic was automatically closed 42 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.