Learn R Programming

rsMove (version 0.2.5)

moveReduce: moveReduce

Description

Pixel based summary of movement data that preserves periodic movements.

Usage

moveReduce(x, y, z, 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.

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, the mean timestamp and the elapsed time. The output of the function consists of:

  • points - Shapefile with reduced sample set and its corresponding temporal information.

  • total.time - Raster showing the total time spent at each pixel (if derive.raster is TRUE).

  • indices - Indices for each sample in x showing which samples were aggregated.

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)

}
# }

Run the code above in your browser using DataLab