I have a raster stack and I want to add to it a Date field which will include the year-month-day for every rasterlayer. I have my dates in a one column data.frame.
I tried to do this with
addLayer but it didn't work.
dt<-as.data.frame(as.Date(c('2010-11-1','2008-3-25','2007-3-14','2007-3-18','2007-3-20'))) ras = raster(matrix(1:30,3,4)) my_s = stack(ras,ras,ras,ras,ras) my_s <- addLayer(my_s, dt)