lookUp: generic key lookUp Generic function to look up keys in a...

Description Usage Arguments Value Author(s)

Description

It works on vector or list data, where the names of each element are the key. It works on vectors with no names, in which case the indices of the keys are returned It works on tabular data, where the key is identified in key.column and the columns returned are specified by data.columns.

Usage

1
2
lookUp(keys, data, key.column = "row.names", data.columns = NULL,
  mode = c("all", "first"))

Arguments

keys

a vector of search keys (ie words)

data

a vector, matrix or data.frame

key.column

the key column if data is a matrix or data.frame. default is to use the “row.names”

data.columns

which columns to search in if data is tabular? default=NULL, which searches all columns

mode

find “all” matches, or the “first” match (faster)?

Value

the values corresponding to the keys

Author(s)

Mark Cowley, 2009-07-09


drmjc/mjcbase documentation built on May 15, 2019, 2:27 p.m.