# NOT RUN {
{
require(raster)
# read raster data
file <- list.files(system.file('extdata', '', package="rsMove"), 'ndvi.tif', full.names=TRUE)
r.stk <- stack(file)
# read movement data
data(shortMove)
# find sample regions
label <- labelSample(xy=shortMove, agg.radius=500, nr.pixels=2, pixel.res=30)
# select background samples
ind <- which(label>0) # selected samples
bSamples <- backSample(xy=shortMove[ind,], region.id=label[ind],
env.data=r.stk, sampling.method='random')
}
# }
Run the code above in your browser using DataLab