recodeAs: Recode unique values of one variable to match unique values...

Description Usage Arguments Details Value Author(s) See Also

View source: R/merge_utils.R

Description

Recode unique values of one variable to match unique values of another variable.

Usage

1
recodeAs(A, B)

Arguments

A

The character vector/factor to recode.

B

The character vector/factor whose unique values are to be copied.

Details

This function is a wrapper around recodeVar. It can be used when you need to recode a character variable/factor so that the values correspond with those of another variable (e.g. when merging datasets with slightly different value labels). The matchstrings function is used to guess the best mapping between the values of 'A' and the values of 'B'. Use this function with care.

Value

The recoded version of 'A'

Author(s)

Ben Veal

See Also

recode for recoding numbers (in library(car)), recodeVar, recodeMatch, colwise2 for recoding multiple dataframe columns simultaneously (in library(plyr)).


vapniks/mergeutils documentation built on May 3, 2019, 4:33 p.m.