Hi,

 

I have a vector "v" and would like to find the number of occurrence of
element "x" in the same.

Is there a way other than,

 

sum(as.integer(v==x)) or length(which(x==v))

 

to do the this.

 

I have a huge file to process and do this.  Both the above described methods
are pretty slow while dealing with a large vector.

Please have your comments.

 

Praveen Surendran.

 


        [[alternative HTML version deleted]]

______________________________________________
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.

Reply via email to