Description Usage Arguments Details Value See Also Examples
Pixel based summary of movement data that preserves periodic movements.
1 | moveReduce(x, y, z, preserve.revisits = TRUE, derive.raster = FALSE)
|
x |
Object of class SpatialPoints or SpatialPointsDataFrame. |
y |
Object of class RasterLayer, RasterStack or RasterBrick. |
z |
Object of class Date, POSIXlt or POSIXct with the observation time of x. |
preserve.revisits |
Logical. Should the function preserve revisit patterns? |
derive.raster |
Should a RasterLayer with the total time per pixel be provided? |
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.
A list object.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | {
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)
}
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.