On Dec 10, 2009, at 2:55 PM, Ramya wrote:
I have tow vectors one is the subset of another
x is a subset of X Both are vectors with n elements
X[X %in% x] would give me x again rite because it is a subset but i
want all
those are not in x from X.
X[which(X != x)] should this do that
Perhaps you think R _should_ read your mind, but we are not there yet.
Try instead:
X[!(X %in% x)]
--
David Winsemius, MD
Heritage Laboratories
West Hartford, CT
______________________________________________
R-help@r-project.org mailing list
https://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, reproducible code.