Reads in a .xlsx file for data validation. Checks that all author emails supplied in the column author_email_list are valid NPS emails. Each instance of author emails contain a single email or a comma separated list of emails (e.g. just joe.smith@nps.gov or joe.smith@nps.gov, jane.doe@partner.nps.gov). If any email is not a valid NPS email, the function will throw an error and list the invalid emails (check for typos!). If all emails supplied are valid NPS emails, the function will pass. This function uses an API rather than Active Directory to access lists of valid NPS emails. If the reference type is a Project, this function will test the leads_email_list column instead of the author_email_list column.

check_author_email(
  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_author_email("test_file.xlsx")} # }