Learn R Programming

rsMove (version 0.2.3)

moveReduce: moveReduce

Description

Pixel based summary of movement data that preserves periodic movements.

Usage

moveReduce(xy = xy, obs.time = obs.time, img = img)

Arguments

xy

Object of class SpatialPoints or SpatialPointsDataFrame.

obs.time

Object of class Date, POSIXlt or POSIXct with xy observation dates.

img

Object of class RasterLayer, RasterStack or RasterBrick.

Value

A list object.

Details

Reduces a set of input samples (xy) based on their corresponding pixel coordinates within a reference raster (img). Using this data, the function identifies temporal segments corresponding to groups of consecutive samples found 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:

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

  • total.time - Raster showing the total time spent at each pixel.

  • indices - Indices for each sample in xy 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
 obs.time <- strptime(paste0(shortMove@data$date, ' ', shortMove@data$time),
 format="%Y/%m/%d %H:%M:%S")

 # reduce amount of samples
 move.reduce <- moveReduce(xy=shortMove, obs.time=obs.time, img=r)

}
# }

Run the code above in your browser using DataLab