# NOT RUN {
# load Tura dataset
data(tura)
## apply a very crude gap-fill using 2 Landsat
# the 1st layer has alot of gaps from the cloud mask
# suppose this is our target image and we want to use the 2nd layer to fill
# just take these two layers
gapfill <- tura[[c(1:2)]]
names(gapfill) <- c("target", "fill")
plot(gapfill)
# flatten the Brick to fill the gaps (NA's in the 1st layer)
filled <- flattenBrick(gapfill)
plot(filled)
# }
Run the code above in your browser using DataLab