sanitize_excel_sheet_names: Sanitize excel sheet names

View source: R/utils.R

sanitize_excel_sheet_namesR Documentation

Sanitize excel sheet names

Description

Convert a vector to valid excel sheet names by:

  • trimming names down to 31 characters,

  • ensuring each element of the vector is unique, and

  • removing the illegal characters ⁠\ / * [ ] : ?⁠

[ ]: R:%20

Usage

sanitize_excel_sheet_names(x, replace = "_")

Arguments

x

a vector (or anything that can be coerced to one via as.character()).

replace

a scalar character to replace illegal characters with

Value

a character vector of valid excel sheet names

Examples


sanitize_excel_sheet_names(
  c("a very: long : vector? containing some illegal characters",
    "a very: long : vector? containing some illegal characters")
)

  # [1] "a very_ long  vector_ containi0" "a very_ long  vector_ containi1"

tatoo documentation built on March 31, 2023, 8:16 p.m.