# NOT RUN {
{
require(raster)
# read raster data
r <- raster(system.file('extdata', '2013-07-16_ndvi.tif', package="rsMove"))
# read movement data
data(shortMove)
# observation time
obs.time <- strptime(paste0(shortMove@data$date, ' ',shortMove@data$time),
format="%Y/%m/%d %H:%M:%S")
# perform directional sampling
of <- function(x) {lm(x~c(1:length(x)))$coefficients[2]}
s.sample <- spaceDir(shortMove, r, "backward", "cont", obs.time=obs.time, stat.fun=of)
}
# }
Run the code above in your browser using DataLab