Learn R Programming

sits (version 1.5.2)

sits_select: Filter bands on a data set (tibble or cube)

Description

Filter only the selected bands and dates from a set of time series or from a data cube.

Usage

sits_select(data, ...)

# S3 method for sits sits_select(data, ..., bands = NULL, start_date = NULL, end_date = NULL)

# S3 method for raster_cube sits_select( data, ..., bands = NULL, start_date = NULL, end_date = NULL, dates = NULL, tiles = NULL )

# S3 method for default sits_select(data, ...)

Value

Tibble with time series or data cube.

Arguments

data

Tibble with time series or data cube.

...

Additional parameters to be provided

bands

Character vector with the names of the bands.

start_date

Date in YYYY-MM-DD format: start date to be filtered.

end_date

Date in YYYY-MM-DD format: end date to be filtered.

dates

Character vector with sparse dates to select.

tiles

Character vector with the names of the tiles.

Author

Rolf Simoes, rolf.simoes@inpe.br

Examples

Run this code
# Retrieve a set of time series with 2 classes
data(cerrado_2classes)
# Print the original bands
sits_bands(cerrado_2classes)
# Select only the NDVI band
data <- sits_select(cerrado_2classes, bands = c("NDVI"))
# Print the labels of the resulting tibble
sits_bands(data)
# select start and end date
point_2010 <- sits_select(point_mt_6bands,
              start_date = "2000-01-01",
              end_date = "2030-12-31")

Run the code above in your browser using DataLab