get_best_locations: Flag for and remove erroneous detections

Description Usage Arguments Value Examples

View source: R/getBestLocations.R

Description

The best location is considered to be the location where the highest power detection occurred. The best location will be flagged if there are fewer than n_thresh detections within a distance of dist_max m from the best detection during the detection period. The best location will also be flagged if a negative linear relationship does not exist between the signal strength and the distance to the highest powered detection for all detections within dist_max km from the best signal in the detection period.

Usage

1
2
3
4
5
6
7
8
get_best_locations(
  detects,
  date_bins = NA,
  bin_by = 1,
  n_thresh = 5,
  dist_max = 10000,
  remove_flagged = F
)

Arguments

detects

The output of combine_data.

date_bins

A matrix of two columns manually specifying the detection periods. The first column represents the detection period start dates whereas the second column represents the detection period end dates. The dates should be in string format "d/m/y." If the date_bins argument is specified, bin_by will be ignored. The function get_date_bins is provided to assist in the construction of date_bins.

bin_by

Specifies the length (in days) of the detection periods. If bin_by=2, the best location will be found for each fish in two day bins.

n_thresh

See description.

dist_max

See description.

remove_flagged

If remove_flagged=T, all flagged detections will be removed.

Value

Returns a list containing two data.frames. $all_detects adds some useful to all_data:

$best_detects contains the highest power detections only:

Examples

1
2
3
4
5
6
par(mfrow=c(2,1))
make_plot(sldf, river_detects, open_maps=T)
best_locations <- get_best_locations(river_detects, date_bins =  date_bins, remove_flagged = T)
head(best_locations$all_detects)
head(best_locations$best_detects)
make_plot(sldf, best_locations$best_detects, open_maps=T)

jBernardADFG/telprep documentation built on July 26, 2020, 2:17 a.m.