rsMove (version 0.2.8)

moveReduce: moveReduce

Description

Pixel based summary of movement data that preserves periodic movements.

Usage

moveReduce(x, y, z, preserve.revisits = TRUE, derive.raster = FALSE)

Arguments

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?

Value

A list object.

Details

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.

See Also

sampleMove moveSeg

Examples

Run this code
# 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