ts_raster | R Documentation |
This function assembles a raster time series by assigning or interpolating input rasters to a target time series.
ts_raster( r_list, r_times, out_times = NA, fade_raster = FALSE, ..., verbose = TRUE )
r_list |
a list of raster objects. |
r_times |
POSIXct, a vector of times corresponding to the elements of |
out_times |
POSIXct, a vector of times for which output rasters will be created. |
fade_raster |
(Optional) logical. If |
... |
additional arguments. |
verbose |
(Optional) logical. If |
a list of raster objects.
Jakob Schwalb-Willmann, Johannes Mast
#Setup library(rtsVis) # Load example dataset at a greatly increased interval x_list <- MODIS_SI_ds[seq(1,length(MODIS_SI_ds),30)] x_dates <- do.call(c, lapply(MODIS_SI_ds,attr,"time") )[seq(1,length(MODIS_SI_ds),30)] #Fill NAs x_list_filled <- ts_fill_na(x_list) #Make a sequence of output dates, double the length of input dates out_dates <-seq.POSIXt(from = x_dates[1], to = x_dates[length(x_dates)],length.out = length(x_dates)*2 ) #For each output date, interpolate a raster image from the input files r_list_out <- ts_raster(r_list = x_list_filled, r_times = x_dates, out_times = out_dates, fade_raster = TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.