vlookup: Vectorized lookup

Description Usage Arguments Value Examples

Description

This function does a vectorized lookup on a data.frame. That is, each individual row is matched with a particular column.

Usage

1
vlookup(df, rowValues, colValues)

Arguments

df

A data.frame

rowValues

A vector of the row values to lookup, matched element by element with colValues

colValues

A vector of the column values to lookup, matched element by element with rowValues

Value

A vector from df[x,y] where x and y are pulled in matched pairs

Examples

1
2
df.eg <- as.data.frame(matrix(1:100,10,10))
vlookup(df.eg,c(1:6,6:1),rep(c("V1","V2"),each=6))

drknexus/repsych documentation built on May 15, 2019, 2:19 p.m.