This function is deprecated in favor of match_names() and will be
removed in a future release.
vector.namesmatch(v, names, errname = NULL)
Arguments
- v
a vector (or list) with named elements, to be reorderd
- names
a character vector of element names, corresponding to names of
v, specificying desired orering of v
- errname
optional, name to be reported in any error messages. default
to deparse(substitute(v))
Value
returns v, with elements reordered
Note
earlier versions of this function did not order as advertised
Examples
test<-list(c=1,b=2,a=3)
vector.namesmatch(test,names=c('a','c','b'))
#> $a
#> [1] 3
#>
#> $c
#> [1] 1
#>
#> $b
#> [1] 2
#>