Description Usage Arguments Value Examples
View source: R/pub01_utilityFuncs.R
vloolup.df
1 2 |
x |
a data frame |
table |
a data frame |
by |
a vector of character string |
ret |
a vector of character string or integer |
exclude.x |
a logical. If the |
a data frame (or a vector if exclude.x
is TRUE and length of ret
is 1).
1 2 3 4 5 6 7 8 9 10 | x <- data.frame(m1=1:3,m2=c("a","b","c"))
table <- data.frame(K1=c(2,3,1,5,6),K2=c("b","c","a","f","x"),v1=LETTERS[1:5],v2=LETTERS[8:12])
vlookup.df(x,table,c("K1","K2"))
y <- data.frame(m1=c(1,3,1),m2=c("a","c","a"))
vlookup.df(y,table,c("K1","K2"))
z <- data.frame(m1=c(1,5,3),m2=c("a","a","c"))
vlookup.df(z,table,c("K1","K2"))
vlookup.df(z,table,c("K1","K2"), exclude.x=FALSE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.