Hi,

>From the dscription, looks like you need ?rle()
vec1 <- c(111, 106, 117, 108, 120, 108, 108, 116, 116, 113) 
 res <- rle(vec1)$lengths
 names(res) <- rle(vec1)$values
 res[res>1]
#108 116 
#  2   2 

length(res[res>1])



A.K.




On Thursday, November 21, 2013 10:12 AM, b. alzahrani <cs_2...@hotmail.com> 
wrote:

hi guys

Assume I have this dataframe:
v3$number_of_ones
[1] 111 106 117 108 120 108 108 116 116 113 
Is there any command in r that gives me the frequency of these numbers (how 
many each number is repeated e.g. the number 108 repeated 2 and 111 repeated 
one an so on)

I have around 10^6 number and would like to see how many each number if 
repeated.

Regards
******************************************************************
Bander Alzahrani, 


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


______________________________________________
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