Skip to contents

Shorten variable names to a maximum length of 32 characters

Usage

shorten_var_names(var_names, reverse = FALSE, max_n_char = 32L)

Arguments

var_names

A character vector of variable names.

reverse

Whether to apply the inversion of the shortening logic, i.e. to restore original/unshortened variable names.

max_n_char

Maximum allowed number of characters. It is ensured that the maximum resulting variable name length doesn't exceed this limit. Has no influence on the applied shortening logic. An integerish scalar or Inf for no limit.

Value

A character vector of the same length as var_names.

See also

Other variable name shortening functions: restore_colnames(), shorten_colnames()