On Thu, Jun 24, 2010 at 3:16 PM, john polo <jp...@mail.usf.edu> wrote: > Dear R users, > > I have a list of numbers such as > >> n > [1] 3000 4000 5000 3000 5000 6000 4000 5000 7000 5000 6000 7000 > > and i'd like to set up a loop that will keep track of the number of > occurences of each of the values that occur in the list, e.g. > > 3000: 2 > 4000: 2 > 5000: 4
No need for a loop, just use table(n) ______________________________________________ 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.