rename_matches: Rename an object based on case-insensitive match of the names...

View source: R/rename_matches.R

rename_matchesR Documentation

Rename an object based on case-insensitive match of the names of a reference.

Description

Rename an object based on case-insensitive match of the names of a reference.

Usage

rename_matches(x, y)

Arguments

x

x object which names to restored if they match the reference.

y

Named object to use as reference.

Value

The output is x with as many names changed as case-insensitive matches there are with the reference.

See Also

Other functions for developers: check_crucial_names(), extract_insensitive(), flag_if_group(), is_multiple(), nms_try_rename(), type_ensure()

Other general functions to deal with names: extract_insensitive()

Examples

ref <- data.frame(COL1 = 1, COL2 = 1)
x <- data.frame(col1 = 5, col2 = 1, n = 5)
rename_matches(x, ref)

fgeo.tool documentation built on May 29, 2024, 5:30 a.m.