vecmerge: Merge a vector and a data.frame

Description Usage Arguments Value Author(s)

Description

Merge a vector and a data.frame. This will essentially subset y to the values of y$"by.y" to the values specified in x. If values in x aren't found in y, then NA fields will be filled in.

Usage

1
2
vecmerge(x, y, by.y = "", all.x = TRUE, all.y = FALSE, sort = FALSE,
  unique.x = TRUE)

Arguments

x

a vector of ‘search keys’

y

a data.frame of values

by.y

the column name in y to match the ‘search keys’ in x. To match against the rownames(y), set this to 0, or “row.names

all.x

logical: return all values in x, even if they're not in y?

all.y

logical: return all rows in y, even if they're not in x?

sort

logical: Should the results be sorted on the by.y column?

unique.x

logical: if TRUE, then keep at most one match for each value of x; if FALSE, then allow aech value in x to match multiple rows in y

Value

a data.frame with same columns as y, but with rows specified by the search keys in x, and the value of unique.x.

Author(s)

Mark Cowley, 18 April 2006


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