Learn R Programming

Rnightlights (version 0.2.4)

allValid: Check if a vector/list of values given is valid as per the given validation function

Description

Check if a vector/list of values given is valid as per the given validation function. The function will also print a warning showing the values that are invalid. One can stop the warning being printed by wrapping the function in the suppressWarnings function.

Usage

allValid(testData, testFun, ...)

Arguments

testData

The list/vector of values to validate

testFun

The validation function to test each value of testData against

...

Other parameters to pass on to the testFun

Value

TRUE/FALSE

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
  Rnightlights:::allValid(c("KEZ", "UGA", "RWA", "TZA"), Rnightlights:::validCtryCodes)
# }
# NOT RUN {
 
# }
# NOT RUN {
  Rnightlights:::allValid(c("2012", "2015"), validNlPeriods, "OLS.Y")
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab