Learn R Programming

rsMove (version 0.2.4)

sampleMove: sampleMove

Description

Remote sensing oriented sampling of stops along a movement track.

Usage

sampleMove(xy, obs.time, search.radius, distance.method = "m",
  time.unit = NULL)

Arguments

xy

Object of class SpatialPoints or SpatialPointsDataFrame.

obs.time

Object of class Date, POSIXlt or POSIXct with the same length as xy.

search.radius

Sample search radius (in meters).

distance.method

How should the distance be estimated? One of 'm' or 'deg'. Default is 'm'.

time.unit

Time unit to estimate elapsed time. See difftime for keywords. Default is mins.

Value

A SpatialPointsDataFrame with a reduced sample set.

Details

This function finds location where an animal showed little or no movement based on GPS tracking data. It looks at the distance among consecutive samples and places pointer when the distance is bellow the defined threshold (search.radius). When a pointer is found, the function looks at the distance between the pointer and the following samples. While this is below the distance threshold, the samples are assigned to the same segment. Then, for each segment, the function summarizes the corresponding samples deriving mean coordinates, the start, end and total time spent and the total number of samples per segment ('count'). The user should selected distance.method in accordance with the projection system associated to the data. If 'm' it bases this analysis on the the ecludian distance. However, if 'deg' it set, the function uses the haversine formula.

See Also

labelSample backSample dataQuery

Examples

Run this code
# NOT RUN {
{

 require(raster)

# reference data
data(longMove)

 # sampling without reference grid
 obs.time = strptime(longMove$timestamp, "%Y-%m-%d %H:%M:%S")
 output <- sampleMove(longMove, obs.time, 7, distance.method='deg')

 # compare original vs new samples
 plot(longMove, col="black", pch=16)
 points(output$x, output$y, col="red", pch=15)

}
# }

Run the code above in your browser using DataLab