View source: R/standardize_dimnames.R
standardize_dimnames | R Documentation |
Standardize column and/or row names of a matrix or data frame to a standard syntax. This is a wrapper for
standardize_names
, to allow it to be used on data frames and matrices, rather than on their
names. All letters are converted to lowercase, special characters are converted to underscores (snake_case) or removed (camelCase),
and multiple and trailing (but not leading) special characters are removed. By default, elements are
deduplicated by appending "_1" (snake_case) or "1" (camelCase) and so on.
standardize_dimnames(
x, cols = TRUE, rows = FALSE, dedup = TRUE, case = "snake_case")
x |
data frame or matrix with column and/or row names to be standardized |
cols , rows |
logical, whether to standardize the column and row names, respectively. By default, column names are standardized, but row names are not. |
dedup |
logical, whether to deduplicate the vector elements. If TRUE, elements that are identical after standardization are deduplicated by appending "_1", "_2", etc. Defaults to TRUE. |
case |
character, specifying whether to convert to snake_case or camelCase. Abbreviations are accepted. Defaults to snake_case. |
an object of the same type and dimension as x
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.