Your output does not match the requested output, I think the original poster may have used the word "order" differently than how you are thinking.
-- Gregory (Greg) L. Snow Ph.D. Statistical Data Center Intermountain Healthcare greg.s...@imail.org 801.408.8111 > -----Original Message----- > From: r-help-boun...@r-project.org [mailto:r-help-boun...@r- > project.org] On Behalf Of Senthil Kumar M > Sent: Wednesday, December 02, 2009 1:36 PM > To: Lisa > Cc: r-help@r-project.org > Subject: Re: [R] Ordering numbers > > On Wed, Dec 2, 2009 at 3:30 PM, Lisa <lisa...@gmail.com> wrote: > > > > Hello all, > > > > I have a set of numbers that looks like this: > > > >> id <- c(1, 1, 2, 2, 2, 3, 4, 4, 4, 4, 1, 2, 2, 2, 3, 3, 1, 1, 1, 2, > 3, 4, > >> 4, 4, 5, 5) > >> id > > [1] 1 1 2 2 2 3 4 4 4 4 1 2 2 2 3 3 1 1 1 2 3 4 4 4 5 5 > > > > Please ignore the bold numbers, I just want to make my problem clear. > > I am going to order them as this: > > > > 1 1 2 2 2 3 4 4 4 4 5 6 6 6 7 7 8 8 8 9 10 11 11 11 12 12 > > > > Can anyone please help how to get this done? Your help would be > greatly > > appreciated. > > > > Lisa > > > > Hi, > > ?sort > > > sort(id) > [1] 1 1 1 1 1 1 2 2 2 2 2 2 2 3 3 3 3 4 4 4 4 4 4 4 5 5 > > Senthil > > ______________________________________________ > 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.