Hi, I think you can try the function rep().
Example: # this means rep 1 once, 2 twice and 3 three times > rep(c(1,2,3), c(1,2,3)) [1] 1 2 2 3 3 3 # this means rep "A", "B", "C", until it reaches length of 10 > rep(c("A","B","C"), length.out = 10) [1] "A" "B" "C" "A" "B" "C" "A" "B" "C" "A" you can try more example by type: ?rep hope this helps~ -- View this message in context: http://r.789695.n4.nabble.com/Frequency-table-tp4101612p4102614.html Sent from the R help mailing list archive at Nabble.com. ______________________________________________ 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.