Reads in a .txt file for data validation. Uses the NPS Unit Service API to check that the producing_units column contains valid NPS unit codes. If invalid producing units are encountered, the function throws an error and prints a list of the invalid units to the console. If all units are valid, the test passes.

check_prod_units(
  path = getwd(),
  filename = "DSbulkUploadR_input.xlsx",
  sheet_name
)

Arguments

path

String. Path to the file. Defaults to the current working directory.

filename

String. Input file to check. Defaults to "DSbulkdUploadR_input.xlsx"

sheet_name

String. Name of the excel sheet to check.

Value

NULL (invisibly)

Examples

if (FALSE) { # \dontrun{
check_units("test_file.txt")
} # }