Learn R Programming

ltsk (version 1.0.1)

dnb: Time space neighbor search

Description

Identify locations adjacent in both space and time to a given location.

Usage

dnb(query, obs, th)

Arguments

query
a vector of x/y coordinates and time stamp of the query point
obs
coordinates and time stamps of the observed points
th
distance and time thresholds

Value

  • A vector of locations of observed data that are within the given distance and time threshold.

Details

Let query point denote the X/Y coordinates and time stamp for which neighbour search is needed. Query point may represent the spatio-temporal location of a case. Neighbouring data are needed for exposure assessment.

Let observed points denote all locations (X/Y coordinates and time stamps) with observed exposure data. This function identified the observed data within a given distance and time thresholds. Observed data within a given radius and time period both prior to and after the query location will be included.

Examples

Run this code
data(epa_cl)
coords <- c('x','y','t')
ii <- dnb(query[1,coords],obs[,coords],c(0.1,10))

Run the code above in your browser using DataLab