Rename an object based on case-insensitive match of the names of a reference.
rename_matches(x, y)
x object which names to restored if they match the reference.
Named object to use as reference.
The output is x with as many names changed as case-insensitive matches there are with the reference.
x
Other functions for developers: check_crucial_names, extract_insensitive, flag_if_group, is_multiple, nms_try_rename, type_ensure
check_crucial_names
extract_insensitive
flag_if_group
is_multiple
nms_try_rename
type_ensure
Other general functions to deal with names: extract_insensitive
# NOT RUN { ref <- data.frame(COL1 = 1, COL2 = 1) x <- data.frame(col1 = 5, col2 = 1, n = 5) rename_matches(x, ref) # }
Run the code above in your browser using DataLab