repair_names {tibble} | R Documentation |
repair_names
ensures its input has non-missing and
unique names (duplicated names get a numeric suffix). Valid names are
left as is.
repair_names(x, prefix = "V", sep = "")
x |
A named vector. |
prefix |
A string, the prefix to use for new column names. |
sep |
A string inserted between the column name and de-duplicating number. |
x
with valid names.
repair_names(list(3, 4, 5)) # works for lists, too repair_names(mtcars) # a no-op tbl <- as_tibble(structure(list(3, 4, 5), class = "data.frame"), validate = FALSE) repair_names(tbl)