Dear all, I'm sorry I have to bother you with this newbie stuff.
Within a loop I obtain pairs of values x <- c(a, b). An empty set M is defined before the loop (as a list or whatever). Now I want to do the following: if there is a vector y in M that contains at least one of the values of x, then x shall be concatenated to y. If y doesn't contain any of the values in x, then x shall be put into M as a new vector. I first imagined it to be trivial but I'm having a hard time with the if-statement. I tried to define a function contains(value, vector), which returns FALSE or TRUE, but R complains that I tried to execute a "non-function"... Could anybody help a despaired newbie, please! Thanks a lot, John ______________________________________________ [email protected] 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.
