vlookup: vlookup

View source: R/vlookup.R

vlookupR Documentation

vlookup

Description

vlookup

Usage

vlookup(this, data, key, value, add = FALSE)

Arguments

this

A vector of values

data

A data frame to search in

key

Where should this be looked up?

value

Name of the column from which values should be returned.

add

Should this and the resulting values be returned as a data frame? (Else a vector)

Examples

df <- data.frame(
  a = letters[c(1, 1:9)],
  b = 51:60
)

vlookup(c("a", "e", "c"), df, key = "a", value = "b")
vlookup(c("a", "e", "c"), df, key = "a", value = "b", add = TRUE)


mattansb/MSBMisc documentation built on March 22, 2023, 6:02 p.m.