Learn R Programming

contact (version 1.2.1)

findDistThresh: Identify Point-Based Distance Threshold for Contact

Description

Sample from a multivariate normal distribution to create "in-contact" n point pairs based on real-time-location systems accuracy, and generate a distribution describing observed distances between point ppairs.

Usage

findDistThresh(
  n = 1000,
  acc.Dist1 = 0.5,
  acc.Dist2 = NULL,
  pWithin1 = 90,
  pWithin2 = NULL,
  spTh = 0.666
)

Arguments

n

Integer. Number of "in-contact" point-pairs used in the expected-distance distribution(s). Defaults to 1000.

acc.Dist1

Numerical. Accuracy distance for point 1.

acc.Dist2

Numerical. Accuracy distance for point 2. If == NULL, defaults to acc.Dist1 value.

pWithin1

Numerical. Percentage of data points within acc.Dist of true locations for point 1.

pWithin2

Numerical. Percentage of data points within acc.Dist of true locations for point 2. If == NULL, defaults to pWithin1 value.

spTh

Numerical. Pre-determined distance representing biological threshold for contact.

Value

Output is a named vector with 22 observations describing the mean, max, and upper 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55, 60, 65, 70, 75, 80, 85, 90, 95, 99-percent CI values, and the true-positive rate (i.e., TPR) calculated from the contact-distance distribution.

Details

This function is for adjusting contact-distance thresholds (spTh) to account for positional accuracy of real-time-location systems, assuming random (non-biased) error in location-fix positions relative to true locations. Essentially this function can be used to determine an adjusted spTh value that likely includes >= 99-percent of true contacts defined using the initial spTh.

References

Farthing, T.S., Dawson, D.E., Sanderson, M.W., and Lanzas, C. in Press. Accounting for space and uncertainty in real-time-location- system-derived contact networks. Ecology and Evolution.

Examples

Run this code
# NOT RUN {
findDistThresh(n = 10,  acc.Dist1 = 0.5, acc.Dist2 = NULL, 
   pWithin1 = 90, pWithin2 = NULL, spTh = 0.5) 

# }

Run the code above in your browser using DataLab