Learn R Programming

rtsVis (version 0.0.3)

ts_fill_na: Fill NA values in a raster time series

Description

Fill NA values in a raster time series

Usage

ts_fill_na(x_list_fill, maskvalues = NULL, verbose = FALSE, ...)

Arguments

x_list_fill

a list of raster objects.

maskvalues

numeric, a vector of values to be set to NA before the masking.

verbose

(Optional) logical. If TRUE outputs progress. Default is FALSE.

...

additional arguments to be passed on to approxNA. Of particular interest is the rule argument which defines how first and last cells are dealt with.

Value

A list of rasters with NAs filled.

Details

Loads all layers of a specific bands into a stack and uses approxNA to fill the NAs if possible. Note that the procedure requires the entire list of raster layery for each band to be be stacked. It is therefore very memory intensive and likely to fail for very large time series.

Examples

Run this code
# NOT RUN {
#Setup
 library(rtsVis)
x_list <- MODIS_SI_ds[seq(1,length(MODIS_SI_ds),15)]   #A list of raster objects

#Fill NAs
x_list_filled <- ts_fill_na(x_list) 
# }

Run the code above in your browser using DataLab