sits_merge {sits} | R Documentation |
Merge two data sets (time series or cubes)
Description
To merge two series, we consider that they contain different attributes but refer to the same data cube, and spatiotemporal location. This function is useful to merge different bands of the same locations. For example, one may want to put the raw and smoothed bands for the same set of locations in the same tibble.
To merge data cubes, they should share the same sensor, resolution, bounding box, timeline, and have different bands.
Usage
sits_merge(data1, data2, ...)
## S3 method for class 'sits'
sits_merge(data1, data2, ..., suffix = c(".1", ".2"))
## S3 method for class 'sar_cube'
sits_merge(data1, data2, ...)
## S3 method for class 'raster_cube'
sits_merge(data1, data2, ...)
## Default S3 method:
sits_merge(data1, data2, ...)
Arguments
data1 |
Time series (tibble of class "sits") or data cube (tibble of class "raster_cube") . |
data2 |
Time series (tibble of class "sits") or data cube (tibble of class "raster_cube") . |
... |
Additional parameters |
suffix |
If there are duplicate bands in data1 and data2 these suffixes will be added (character vector). |
Value
merged data sets (tibble of class "sits" or tibble of class "raster_cube")
Author(s)
Gilberto Camara, gilberto.camara@inpe.br
Examples
if (sits_run_examples()) {
# Retrieve a time series with values of NDVI
point_ndvi <- sits_select(point_mt_6bands, bands = "NDVI")
# Filter the point using the Whittaker smoother
point_whit <- sits_filter(point_ndvi, sits_whittaker(lambda = 3.0))
# Merge time series
point_ndvi <- sits_merge(point_ndvi, point_whit, suffix = c("", ".WHIT"))
# Plot the two points to see the smoothing effect
plot(point_ndvi)
}