lookup a value in the second column of a data frame x
where the value
in the first column matches the key
.
Usage
tableLookup(x, key, default = NULL)
Arguments
- x
data frame with at least two columns. Keys are expected to be in the
first and values are expected to be in the second column, respectively.
- key
key for which a value is to be looked up
- default
default value that is returned if the key is not a key of the
lookup table
Value
value looked up in the lookup table of default if key
is not
contained in the first column of the lookup table x