validateFetchedData: Validate to ensure it is not null or empty and has all...

Description Usage Arguments

View source: R/utils-validation.R

Description

Given some data and required fields, will check to ensure that the supplied data is not null or empty and has all required fields. Will throw an error if either of these checks fail. Returns TRUE if the retrieved data is valid with all required fields, returns false otherwise.

Usage

1
2
validateFetchedData(data, name, requiredFields, stopNull = TRUE,
  stopMissing = TRUE, stopEmpty = TRUE)

Arguments

data

the data to check the validity of

name

the name to use for the data when logging errors

requiredFields

a list of the required fields for this data to be valid

stopNull

(optional - default = TRUE) whether or not the function should throw an error if the data is NULL.

stopMissing

(optional - default = TRUE) whether or not the function should throw an error if the data is missing some required fields.

stopEmpty

(optional - default = TRUE) whether or not the function should throw an error if the data is present but empty.


USGS-R/repgen documentation built on April 14, 2021, 2:47 p.m.