ensureFlagValidity: This function checks whether the flags in the data are valid...

Description Usage Arguments Value

Description

This function checks whether the flags in the data are valid according to the flagValidTable.

Usage

1
2
3
4
ensureFlagValidity(data, flagObservationVar = "flagObservationStatus",
  flagMethodVar = "flagMethod", returnData = TRUE, normalised = TRUE,
  denormalisedKey = "measuredElement", flagTable = flagValidTable,
  getInvalidData = FALSE, removeInvalid = TRUE)

Arguments

data

The data to be checked

flagObservationVar

The column name corresponding to the observation status flag.

flagMethodVar

The column name corresponding to the method flag.

returnData

logical, whether the data should be returned

normalised

logical, whether the data is normalised

denormalisedKey

optional, only required if the input data is not normalised.It is the name of the key that denormalises the data.

flagTable

The table containing valid/invalid flag combination. See the dataset flagValidTable in faoswsFlag

getInvalidData

logical, this will skip the test and extract the data that is invalid.

removeInvalid

Even if the original purpose of this function was to highlight

Value

If getInvalidData is FALSE, then the data is returned when the test is cleared, otherwise an error. If getInvalidData is TRUE, then the subset of the data that is invalid is returned.


SWS-Methodology/faoswsEnsure documentation built on May 9, 2019, 11:47 a.m.