Learn R Programming

sits (version 1.12.0)

sits_interp: Interpolation function of the time series of a sits_tibble

Description

Computes the linearly interpolated bands for a given resolution using the R base function approx.

Usage

sits_interp(data.tb = NULL, fun = stats::approx, n = base::length,
  ...)

Arguments

data.tb

A tibble with time series data and metadata.

fun

Interpolation function.

n

Number of time series elements to be created between start date and end date. When a class function is passed to `n`, is is evaluated with each band time series as an argument, e.g. n(band) (default: `length` function).

...

Additional parameters to be used by the fun function.

Value

A tibble with same samples and the new bands.

Examples

Run this code
# NOT RUN {
# Retrieve a time series with values of NDVI
data(point_ndvi)
# find out how many time instances are there
n_times <- NROW(point_ndvi$time_series[[1]])
# interpolate three times more points
point_int.tb <- sits_interp(point_ndvi, fun = stats::spline, n = 3 * n_times)
# plot the result
sits_plot(point_int.tb)
# }

Run the code above in your browser using DataLab