[R] Creating a maxtrix from "conditional prints"

2010-06-04 Thread EM
Hi guys :) I'm dealing with this problem, perhaps conceptually not that complex, but still - I'm stuck. Two columns, values 1https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, re

[R] function in R that's equivalent to SQL's "IN"

2007-10-26 Thread Em C
Hi all, I'm trying to find something like the "==" operator that will work on vectors or something equivalent to SQL's "IN" function. For e.g., if I have: x <- c(1,2,3,4,5) y <- c("apples", "oranges", "grapes", "bananas", "pears") z <- data.frame (x,y) w <- c(2,4,5) I want R to return the values