An embedded and charset-unspecified text was scrubbed... Name: not available Url: https://stat.ethz.ch/pipermail/r-help/attachments/20070610/483c6885/attachment.pl
comparing two vectors
2 messages · gallon li, Hadley Wickham
On 6/10/07, gallon li <gallon.li at gmail.com> wrote:
Suppose I have a vector A=c(1,2,3) now I want to compare each element of A to another vector L=c(0.5, 1.2) and then recode values for sum(A>0.5) and sum(A>1.2) to get a result of (3,2) how can I get this without writing a loop of sums?
How about colSums(outer(A, L, ">")) Hadley