> > intersect(c(1,3,2),c('1','3')) > [1] "1" "3" > > Apparently, intersect() treats num as string. But this is not > documented in the help. Could somebody add it in the future version of > R? >
This is more a general coercion feature. For example 1 == "1", see ?Comparison. > Also according to the help, the argument should not have duplicated > elements. I think this is just because these functions were written with sets in mind, which would not have duplicated values, thus the word "conceptually". The duplicated elements are simply discarded. ______________________________________________ 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.