look_up: Replace x values with corresponding values using a key

View source: R/look_up.R

look_upR Documentation

Replace x values with corresponding values using a key

Description

Replace x values with corresponding values using a key

Usage

look_up(x, table, index = "var", column = 2)

Arguments

x

A string vector to be matched.

table

Lookup table

index

Character string of the key/index column used for matching

column

Column index (integer) or name (string) to return from the lookup table. Default is the second column.

Examples

library(magrittr)
library(dplyr)
iris %>% .$Petal.Width %>%
 look_up(tibble(var=0.2,return="zero-point-two"))

martinctc/surveytools documentation built on Nov. 21, 2024, 10:48 p.m.