if (FALSE) {
file <- system.file("external/ndvi", package="rts")
ndvi <- rts(file) # read the ndvi time series from the specified file
plot(ndvi,1:4) # plot the first 4 layers in the raster time series
plot(ndvi,"/20010101")
plot(ndvi,"20010101/20010501")
plot(ndvi,"2001-02-01/2001-05-01")
plot(ndvi,"2001-02-01")
n1 <- extract(ndvi,125)# extract the time series values at cell number 125 for all times
plot(n1)
n2 <- extract(ndvi,125,"/20090101") # extract the time series values at cell number 125
# for all times after 2009-01-01
n2
plot(n2)
n3 <- extract(ndvi,125:127,"200901/") # extract the time series values at the specified cell
# numbers for all times before 2009-01
n3
plot(n3) # plot the time-series values for the first series in n3 (i.e cell: 125)
plot(n3,y=1:3) # plot for the 3 series in n3 (i.e cells of 125:127)
plot(n3,y=1:3,col=1)
plot(n3,y=1:3,col=c(1,4,5))
plot(n3,y='all')
}
Run the code above in your browser using DataLab