match.names: Name matching helper

Description Usage Arguments Details Examples

Description

match.names

Usage

1
match.names(obj_1, obj_2, inverse = FALSE)

Arguments

obj_1, obj_2

The data objects to compare

inverse

logical Should the negated names be returned or the matched names? Defaults to FALSE for inclusion

Details

Match the names of one list or data frame to an altered list or data frame or key ref table

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
# For brevity
names(mtcars)
[1] "mpg"  "cyl"  "disp" "hp"   "drat" "wt"
    "qsec" "vs"   "am"   "gear" "carb"


mtcars2 <- mtcars[1:4]
names(mtcars2)
[1] "mpg"  "cyl"  "disp" "hp"


> match.names(mtcars,mtcars2)
[1] "mpg"  "cyl"  "disp" "hp"
> match.names(mtcars,mtcars2,T)
[1] "drat" "wt"   "qsec" "vs"   "am"   "gear" "carb"

Rterial/Rtbase documentation built on May 9, 2019, 10:35 a.m.