# NOT RUN {
# Load required libraries
library(ImageFusion)
library(raster)
# Get filesnames of high resolution images
landsat <- list.files(
system.file("landsat/filled",
package = "ImageFusion"),
".tif",
recursive = TRUE,
full.names = TRUE
)
# Get filesnames of low resolution images
modis <- list.files(
system.file("modis",
package = "ImageFusion"),
".tif",
recursive = TRUE,
full.names = TRUE
)
# Create output directory in temporary folder
out_dir <- file.path(tempdir(),"Outputs")
if(!dir.exists(out_dir)) dir.create(out_dir, recursive = TRUE)
# Run the fusion on the entire time series
imagefusion_task(filenames_high = landsat,
dates_high = c(68,77,93,100),
filenames_low = modis,
dates_low = 68:93,
dates_pred = c(65,85,95),
out_dir = out_dir)
# remove the output directory
unlink(out_dir,recursive = TRUE)
# }
Run the code above in your browser using DataLab