lxy.nn.add: Identifies nearest neighbors for a LoCoH-xy object

Description Usage Arguments Details Value See Also Examples

Description

Identifies nearest neighbors for a LoCoH-xy object

Usage

1
2
3
4
5
6
lxy.nn.add(lxy, id = NULL, ptid = NULL, k = NULL, r = NULL,
  a = NULL, s = NULL, kmin = 0, ptsh = NULL, ptsh.idx = 1,
  nn.exists = c("append", "replace", "skip")[1], time.term = c("vmax",
  "dif")[1], FNN.algorithm = c("cover_tree", "kd_tree", "VR", "CR")[2],
  dec.places = 1, ra.init.samp.size = 30, ra.init.quant = 0.8,
  tct = 0.05, beep = FALSE, status = TRUE)

Arguments

lxy

A LoCoH-xy object

id

The name(s) of individuals to analyze

ptid

A vector of ptid indicating which points should have nearest neighbors identified (can be used to speed up processing during testing)

k

Value for the fixed-k method (identify k nearest neighbors of each point)

r

Value for the fixed-r method (identify all points within radius r)

a

Value for the a method (identify all points within cummulative distance a). Can also be a data frame of parameters returned by the auto.a function.

s

The value for s for the time-scaled distance metric

kmin

A minimum number of neighbors to identify for each point

ptsh

The desired proportion of time-selected hulls [0..1], may also be 'all' if the s-ptsh map has already been computed. See details.

ptsh.idx

The index of the saved ptsh-s table. See also summary.locoh.lhs

nn.exists

What to do if nearest neighbors have already been saved: "append", "replace", or "skip"

time.term

The space-time transformation to use in the TSD distance metric: 'vmax' for the maximum velocity transformation (default) or 'dif' for the diffusion transformation

FNN.algorithm

The algorithm to be used in the get.knnx() function in the package FNN

dec.places

The number of decimal places that rmax and amax should be rounded to

ra.init.samp.size

How many randomly selected points to use to come up with the first guess for how many neighbors to find for each point to satisify a (a-method only)

ra.init.quant

The proportion of randomly selected to points to use for the a value when coming up with an initial guess at the number of neighbors to find for each point to satisify a (a-method only)

tct

Temporal continuity threshhold used when a=auto.a

beep

Beep when done (T/F)

status

Show status messages (T/F)

Details

When s > 0, the 'distance' (as defined by the time-scaled distance metric') between two points is a function of their separation in time as well as space.

If ptsh is provided, the script will find a value of 's' such that the proportion of hulls which are time-selected (e.g, consecutive points in time) is equal to ptsh. In this case, no value for s should be passed. If ptsh="all" and the proportion of time selected hulls has already been computed, those values of 's' will be used.

Value

A LoCoH-xy object object with saved information about each points' nearest neighbors

See Also

summary.locoh.lxy to see what nearest neighbors have already been identified auto.a lxy.amin.add lxy.ptsh.add

Examples

1
2
3
4
## Not run: 
# lxy <- lxy.nn.add(lxy, k=10, s=0.01)

## End(Not run)

tlocoh documentation built on May 2, 2019, 5:27 p.m.