check_numeric_range {RoMEBS}R Documentation

Check of the values range in specific fields

Description

The function checks whether the values contained in specific fields are consistent with the allowed range of values.

Usage

check_numeric_range(DataTA, Field, Values, wd, suffix)

Arguments

DataTA

data table according to MEDITS protocol (TX)

Field

Name of the specific field of the selected TX table

Values

Vector of the allowed values for the field to be checked. The first two values are mandatory and indicate the extreme values of the range. The other optional values are single numerical exceptions to the field allowed values.

wd

working directory path defined by the user

suffix

Suffix string of the Logfile

Details

The function checks the consistence of the values contained in specific fields with the relative allowed range of values. The check is performed on any of the "TX" data tables.

Value

The function returns TRUE if no error occurs, while FALSE is returned when there are empty values in data (NA). Furthermore, the function returns a warning message in case a field value is out of the expected range of values. In the logfile is reported the list of all the records in which the inconsistency is detected.

Author(s)

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"
    Field = "SHOOTING_DEPTH"
    Values = c(10,800,0)
    DataTA = MEDITS::TA
    library(RoMEBS)
    check_dictionary(ResultData = DataTA, Field, Values, wd, suffix)

[Package RoMEBS version 0.2.02 Index]