library(rPAex)
data(cropTime)
ndvi<-with(cropTime,(L1-L2)/(L1+L2))
ndviTime<-data.frame(cropTime,ndvi)
fly<-c(1, 2, 6, 11, 20, 23, 30, 36, 38)
dates<-c("2014-12-18","2015-01-06","2015-01-29","2015-02-26","2015-04-22",
"2015-05-15", "2015-07-03","2015-08-13","2015-08-28")
x11()
op<-par(mfrow=c(3,3),mar=c(0,0,1,0),cex=1)
for(i in 1:9){
P<-ndviTime[ndviTime$Flight==fly[i],]
P$ndvi<-(P$L1-P$L2)/(P$L1+P$L2)
I<-terra::rast(P[,c(2,3,7)],type="xyz")
terra::image(I,col= hcl.colors(12, "Greens 3", rev = TRUE),axes=FALSE,
main=paste("fligth:", fly[i]))
}
par(op)
Run the code above in your browser using DataLab