check_distance {RoME}R Documentation

Check of distance consistency

Description

The function checks wherther there are inconsistencies between the DISTANCE field values and the computed distance.

Usage

check_distance(DataTA, year, wd, suffix)

Arguments

DataTA

Haul data table according to MEDITS protocol (TA)

year

reference year for the analysis

wd

working directory path defined by the user

suffix

Suffix string of the Logfile

Details

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'.

Value

The function returns always TRUE because the outcome of the function is a warning that does not lock the execution of the 'RoME' 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.

Author(s)

I. Bitetto, W. Zupa

References

Anonymus. 2017. MEDITS-Handbook. Version n. 9. MEDITS Working Group. 106 pp.https://www.sibm.it/MEDITS 2011/principaledownload.htm

Examples

wd <- tempdir()
suffix="2020-03-05_time_h17m44s55"
year=2007
check_distance(RoME::TA,year,wd,suffix)

[Package RoME version 0.1.23 Index]