# NOT RUN {
require(raster)
# read remote sensing data
file <- list.files(system.file('extdata', '', package="rsMove"), 'ndvi.tif', full.names=TRUE)
r.stk <- stack(file)
# read movement data
data(shortMove)
# observation time
obs.time <- strptime(paste0(shortMove@data$date, ' ', shortMove@data$time),
format="%Y/%m/%d %H:%M:%S")
# remove redundant samples
shortMove <- moveReduce(shortMove, r.stk, obs.time)$points
# retrieve remote sensing data for samples
rsQuery <- extract(r.stk, shortMove)
# identify unique sample regions
label <- labelSample(shortMove, r.stk, agg.radius=30)
# select background samples
bSamples <- backSample(shortMove, r.stk, label, sampling.method='pca')
# derive model predictions
out <- predictResources(rsQuery, bSamples@data, label, env.data=r.stk)
# }
Run the code above in your browser using DataLab