Learn R Programming

matsindf (version 0.4.11)

check_worksheet_name_violations: Develop a warning message for malformed Excel worksheet names

Description

write_mat_to_excel() can include worksheet names, but it is important that they are legal names. This function emits a warning when candidate_worksheet_names is malformed.

Usage

check_worksheet_name_violations(candidate_worksheet_names)

Value

NULL invisibly and a warning if any problems are detected.

Arguments

candidate_worksheet_names

Worksheet names to be checked.

Examples

Run this code
# No warning
check_worksheet_name_violations(c("abc", "123"))
if (FALSE) {
  # Warnings
  # Illegal characters
  check_worksheet_name_violations(c("abc", "["))
  # Empty name
  check_worksheet_name_violations(c("", "abc"))
  # Too long
  check_worksheet_name_violations(strrep("x", 32))
  # Duplicates
  check_worksheet_name_violations(c("abc123", "abc123"))
}

Run the code above in your browser using DataLab