if (sits_run_examples()) {
# Create a data cube from local files
data_dir <- system.file("extdata/raster/mod13q1", package = "sits")
cube <- sits_cube(
source = "BDC",
collection = "MOD13Q1-6.1",
data_dir = data_dir
)
# Get the bands from a daya cube
bands <- sits_bands(cube)
# Get the bands from a sits tibble
bands <- sits_bands(samples_modis_ndvi)
# Get the bands from patterns
bands <- sits_bands(sits_patterns(samples_modis_ndvi))
# Get the bands from ML model
rf_model <- sits_train(samples_modis_ndvi, sits_rfor())
bands <- sits_bands(rf_model)
# Set the bands for a SITS time series
sits_bands(samples_modis_ndvi) <- "NDVI2"
# Set the bands for a SITS cube
sits_bands(cube) <- "NDVI2"
}
Run the code above in your browser using DataLab