tripGrid.interp: Generate a grid of time spent using approximate methods

View source: R/grid.R

tripGrid.interpR Documentation

Generate a grid of time spent using approximate methods

Description

Create a grid of time spent from an object of class trip by approximating the time between locations for separate trip events.

Usage

tripGrid.interp(x, grid = NULL, method = "count", dur = NULL, ...)

kdePoints(x, h = NULL, grid = NULL, resetTime = TRUE, ...)

countPoints(x, dur = 1, grid = NULL)

Arguments

x

object of class trip

grid

GridTopology - will be generated automatically if NULL

method

name of method for quantifying time spent, see Details

dur

The \"dur\"ation of time used to interpolate between available locations (see Details)

...

other arguments passed to interpequal or kdePoints

h

kernel bandwidth

resetTime

rescale result back to the total duration of the input

Details

This set of functions was the the original tripGrid from prior to version 1.1-6. tripGrid should be used for more exact and fast calculations assuming linear motion between fixes.

The intention is for tripGrid.interp to be used for exploring approximate methods of line-to-cell gridding.

Trip locations are first interpolated, based on an equal-time spacing between records. These interpolated points are then "binned" to a grid of cells. The time spacing is specified by the dur (duration) argument to interpequal in seconds (i.e. dur=3600 is used for 1 hour). Shorter time periods will require longer computation with a closer approximation to the total time spent in the gridded result.

Currently there are methods "count" and "kde" for quantifying time spent, corresponding to the functions "countPoints" and "kdePoints". "kde" uses kernel density to smooth the locations, "count" simply counts the points falling in a grid cell.

Value

tripGrid returns an object of class SpatialGridDataFrame, with one column "z" containing the time spent in each cell in seconds. If kdePoints is used the units are not related to the time values and must be scaled for further use.

See Also

bandwidth.nrd for the calculation of bandwidth values used internally when not supplied by the user


trip documentation built on July 9, 2023, 7:29 p.m.