# NOT RUN {
{
require(rgdal)
require(raster)
require(sp)
# read movement data
files <- system.file('extdata', 'konstanz_20130805-20130811.shp', package="rsMove")
moveData <- shapefile(files)
# find sample regions
label <- labelSample(xy=moveData, rad=500, npx=2, pxr=30)
# read remote sensing data
files <- list.files(system.file('extdata', '', package="rsMove"), 'tc.*tif', full.names=TRUE)
rsStk <- stack(files)
# select background samples
ind <- which(label>0) # selected samples
bSamples <- backSample(xy=moveData[ind,], rid=label[ind], img=rsStk, method='random')
}
# }
Run the code above in your browser using DataLab