rename.vars: quick & dirty fn for renaming variable names...

Description Usage Arguments Value See Also Examples

Description

it may make sense to take this out and just use the plyr::rename function from the plyr package

Usage

1
rename.vars(vnames, fromvars, tovars)

Arguments

vnames

the list of names to remap

fromvars

the current variable name

tovars

the new variable name (positions in this vector should correspond to the ones in fromvars)

Value

a vector with vnames renamed according to the mapping from fromvars to tovars

See Also

rename

Examples

1
2
3
4
5
6
## Not run: 
   colnames(my.data) <- rename.vars(colnames(my.data),
                                    c("old_var1", "old_var2"),
                                    c("new_var1", "new_var2"))

## End(Not run)

dfeehan/dhstools documentation built on May 15, 2019, 5:12 a.m.