check_distance {RoMEBS} | R Documentation |
The function checks wherther there are inconsistencies between the DISTANCE field values and the computed distance.
check_distance(DataTA, wd, suffix)
DataTA |
Haul data table according to MEDITS protocol (TA) |
wd |
working directory path defined by the user |
suffix |
Suffix string of the Logfile |
The comparison between distance in TA and computed distance is performed with a tolerance of 30%. The formula used to compute the distance from the start and end coordinates is:
where:
and
All the coordinates involved in the formulas above are in decimal degrees; the routine converts automatically the coordinates listed in TA using the package MEDITS.
The function returns always TRUE because the outcome of the function is a warning that does not lock the execution of the RoMEBS checks. The presence of inconsistencies between DISTANCE field and computed distance is reported in the logfile stored in the "Logfiles"" subdirectory of the "wd" user-defined directory. For the hauls with a computed distance quite different from the distance recorded in TA a plot is produced and stored in Graphs directory to allow an easier correction.
I. Bitetto, W. Zupa
Anonymus. 2017. MEDITS-Handbook. Version n. 9. MEDITS Working Group. 106 pp.https://www.sibm.it/MEDITS 2011/principaledownload.htm
wd <- tempdir() suffix="2020-03-05_time_h17m44s55" library(RoMEBS) check_distance(RoMEBS::TA,wd,suffix)