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
)
# Segment the cube
segments <- sits_segment(
cube = cube,
output_dir = tempdir(),
multicores = 2,
memsize = 4
)
# plot NDVI band of the second date date of the data cube
plot(segments, band = "NDVI", date = sits_timeline(cube)[1])
}
Run the code above in your browser using DataLab