0

I have 8-day modis raster images that go to daily data, the problem is that now I want to get the monthly accumulated in this case of evapotranspiration, I made a code and it works but I'm not sure that the result is correct. how can i check it? Or does anyone know if I applied this code correctly?

I have a stack where the names of the objects are "X2014.01.02" "X2014.01.03" "X2014.01.04" so what I did was extract the parts of the name in year, month and day and then apply the stackApply() function.

et_dia is my stack

dates <- substr(names(et_dia), 2,11)
date_parts <- strsplit(dates, "\\.")
año<-sapply(date_parts, function(x) x[[1]])
mes<-sapply(date_parts, function(x) x[[2]])
año_mes <- paste(año, mes, sep = ".")

# Calcular los promedios mensuales 
et_month <- stackApply(et_dia, año_mes, fun = sum)

0 Answers0