# NOT RUN {
{
require(raster)
# read raster data
file <- list.files(system.file('extdata', '', package="rsMove"), 'tc.*tif', full.names=TRUE)
rsStk <- stack(file)
# read movement data
moveData <- read.csv(system.file('extdata', 'konstanz_20130805-20130811.csv', package="rsMove"))
moveData <- SpatialPointsDataFrame(moveData[,1:2], moveData, proj4string=crs(rsStk))
# find sample regions
label <- labelSample(xy=moveData, rad=500, npx=2, pxr=30)
# 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