Dear R forum

I have a vector say as given below

df = c("F", "C", "F", "B", "D", "A", "D", "D", "A", "F", "D", "F", "B",    "C")

I need to find 

(1) how many times each element occurs? e.g. in above vector F occurs 4 times, 
C occurs 2 times etc.

(2) Depending on the number of occurrences, I need to repeat the element 100 
times of the occurrences e.g. I need to repeat F 6 * 100 = 600 times, C 2*100 = 
200 times.

I can manage the second part i.e. repeating but I am not able to count the 
number of times the element is appearing in a given vector.

Kindly guide 
 
Katherine











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