Dear all, I have a data frame, where multible process and ordering done ..can I re arrange (re order ) it regarding it' s original ROW index ? how? example Xi items numrber_list_items 3 8 8, 7, 3, 4 4 2 7 7, 3, 4 0 1 10 10 1 result should be starting from row index 1 to 3. thanks in advance Ragia [[alternative HTML version deleted]]
Hello, If your data.frame is named 'dat', try something like the following. dat[order(rownames(dat)), ] Hope this helps, Rui Barradas Em 28-08-2014 08:56, Ragia Ibrahim escreveu:> Dear all, > I have a data frame, where multible process and ordering done ..can I re arrange (re order ) it regarding it' s original ROW index ? how? > example > Xi items numrber_list_items > 3 8 8, 7, 3, 4 4 > 2 7 7, 3, 4 0 > 1 10 10 1 > result should be starting from row index 1 to 3. > > thanks in advance > Ragia > > > [[alternative HTML version deleted]] > > ______________________________________________ > R-help at 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. >
For future reference, perhaps creating an index variable when the data frame is first created and before ?multiple process and ordering? is done would be good. mydat$index <- seq(nrow(mydat)) -- Don MacQueen Lawrence Livermore National Laboratory 7000 East Ave., L-627 Livermore, CA 94550 925-423-1062 On 8/28/14, 12:56 AM, "Ragia Ibrahim" <ragia11 at hotmail.com> wrote:>Dear all, >I have a data frame, where multible process and ordering done ..can I re >arrange (re order ) it regarding it' s original ROW index ? how? >example > Xi items numrber_list_items >3 8 8, 7, 3, 4 4 >2 7 7, 3, 4 0 >1 10 10 1 >result should be starting from row index 1 to 3. > >thanks in advance >Ragia > > > [[alternative HTML version deleted]] > >______________________________________________ >R-help at 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.