Plot raster layers corresponding to specified times, or plot extracted time-series values at a location (cell) or a number of cells as a
1 2 3 4
an object of raster time series class (
additional argument as in
x is a
This function, first, selects the layers corresponding to the time range specified in
y and then call
plot function in
raster package to plot the selected raster layers. If
y is not specified, all layers will be sent to
Same as in
subset functions, When a raw character vector is used for the
y, it is processed as if it was ISO-8601 compliant. This means that it is parsed from left to right, according to the following specification:
A full description will be expanded from a left-specified truncated one.
Additionally, one may specify range-based queries by simply supplying two time descriptions seperated by a forward slash:
CCYYMMDD HH:MM:SS.ss+/CCYYMMDD HH:MM:SS.ss
x can be an
rts is a subclass of
xts, created by
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
## Not run: 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') ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.