Re: [R] Counting elements in columns

From: helin_susam <>
Date: Sat, 16 Apr 2011 20:16:21 -0700 (PDT)

try this;

sum(sapply(a, function(x) (x==b)))

View this message in context:
Sent from the R help mailing list archive at

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Sun 17 Apr 2011 - 06:49:52 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 17 Apr 2011 - 07:00:30 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.

list of date sections of archive