require(ggplot2)
require(lubridate)
require(scales)
head(VN2013VGTm,3)
## ID Date DOY NDVI QF QF0
## 1 1 2013-01-03 3 0.836 <NA> NA
## 2 2 2013-01-03 3 0.840 <NA> NA
## 3 3 2013-01-03 3 0.828 <NA> NA
head(VN2013m[1:3,],3)
## ID Date DOY NDVI QF QF0
## 1 1 2013-01-01 1 0.808 <NA> NA
## 2 2 2013-01-01 1 0.808 <NA> NA
## 3 3 2013-01-01 1 0.796 <NA> NA
Define time limits and label positioning
fini <- ymd("20130101")
ffin <- ymd("20140101")
datebreaks <- seq(fini, ffin, by="3 month")
Time series for the 18 pixels (grid) of Valderejo (X axis DOY)
ggplot() +
geom_point(data=VN2013VGTm,aes(x=DOY,y=NDVI)) +
geom_line(data=VN2013VGTm,aes(x=DOY,y=NDVI,group=ID),col="red") +
geom_point(data=VN2013m,aes(x=DOY,y=NDVI)) +
geom_line(data=VN2013m,aes(x=DOY,y=NDVI,group=ID),col="green") +
facet_wrap(~ID,nrow=3,ncol=6) +
ggtitle("Valderejo 2013 NDVI V1 (red) and NDVI V2 (green) compared")
#ggsave("Val2013V1_V2comparedDOY.jpeg")
Time series for the 18 pixels of Valderejo (individual observations + mean)
ggplot() +
geom_point(data=VN2013VGTm, aes(x=Date,y=NDVI),col="red") +
geom_point(data=VN2013m, aes(x=Date,y=NDVI),col="blue") +
stat_summary(data=VN2013VGTm,aes(x=Date,y=NDVI),fun.data ="mean_sdl", mult=1,
geom = "smooth",colour="red") +
stat_summary(data=VN2013m, aes(x=Date,y=NDVI),fun.data ="mean_sdl", mult=1,
geom = "smooth",colour="blue") +
scale_x_datetime(breaks = date_breaks("1 month"),
labels = date_format("%m")) +
xlab("") + ylab("NDVI") +
#theme(axis.text.x = element_text(angle = 45, hjust = 1)) +
ggtitle("Valderejo 2013 V1 (red) and V2 (blue) compared")
#ggsave("Val2013V1_V2compared_median.bmp")