Last chance! 50% off unlimited learning
Sale ends in
Pixel based summary of movement data that preserves periodic movements.
moveReduce(x, y, z, preserve.revisits = TRUE, derive.raster = FALSE)
Object of class SpatialPoints or SpatialPointsDataFrame.
Object of class RasterLayer, RasterStack or RasterBrick.
Object of class Date, POSIXlt or POSIXct with the observation time of x.
Logical. Should the function preserve revisit patterns?
Should a RasterLayer with the total time per pixel be provided?
A list object.
Translates (x) into pixel coordinates within a reference raster (y). The function identifies temporal segments corresponding to groups of consecutive observations within the same pixel. In this process, revisits to recorded pixels are preserved. Once the segments are identified, the function derives mean x and y coordinates for each of them and evaluates the time spent within each pixel. The function reports on the start and end timestamps and the elapsed time. If preserve.revisits is FALSE, the function will then summarize the output on a pixel level summing the time spent at each pixel. Additionally, if derive.raster is TRUE, the function will derive a RasterLayer with the same configuration as y depicting the the total amount of time spent per pixel. The output of the function consists of:
points - SpatialPointsDataFrame with the reduced sample set.
total.time - RasterLayer depicting the total time spent at each pixel.
# 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
z <- strptime(paste0(shortMove@data$date, ' ', shortMove@data$time),
format="%Y/%m/%d %H:%M:%S")
# reduce amount of samples
move.reduce <- moveReduce(shortMove, r, z, derive.raster=TRUE)
}
# }
Run the code above in your browser using DataLab