Learn R Programming

sits (version 1.1.0)

sits_merge: 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, ..., suffix = c(".1", ".2"))

# S3 method for sits sits_merge(data1, data2, ..., suffix = c(".1", ".2"))

# S3 method for raster_cube sits_merge(data1, data2, ..., suffix = c(".1", ".2"))

Value

merged data sets

Arguments

data1

Time series or cube to be merged.

data2

Time series or cube to be merged.

...

Additional parameters

suffix

If there are duplicate bands in data1 and data2 these suffixes will be added.

Author

Gilberto Camara, gilberto.camara@inpe.br

Examples

Run this code
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)
}

Run the code above in your browser using DataLab