Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8838905
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T10:06:58+00:00 2026-06-14T10:06:58+00:00

Possible Duplicate: How to sort a dataframe by column(s) in R everyone: I want

  • 0

Possible Duplicate:
How to sort a dataframe by column(s) in R

everyone:
I want to sort the data within groups using R. For example:
the data is:

geneID  Nr.annotation
CL1002  uncharacterized
CL1002  uncharacterized
CL1002  uncharacterized
CL1002  uncharacterized
CL1002  uncharacterized
CL1002  uncharacterized
CL1019  PREDICTED:
CL1019  PREDICTED:
CL1019  predicted
CL1019  PREDICTED:
CL1019  PREDICTED:
CL1019  predicted
CL1019  predicted
CL1019  hypothetical
CL10246 unnamed
CL10246 predicted
CL10246 unnamed
CL10246 unnamed
CL10246 unnamed
CL10246 unnamed
CL10246 unnamed
CL1064  octicosapeptide/Phox/Bem1p
CL1064  octicosapeptide/Phox/Bem1p
CL1064  serine/threonine
CL1064  serine/threonine
CL1064  serine/threonine
CL1064  serine/threonine

This is the original data. Please copy and use the code as follows:

read.table("clipboard",strip.white=T,header=T)

And then, what should I do? After sorted, I want the result to be this:

geneID  Nr.annotation
CL1002  PREDICTED:
CL1002  uncharacterized    4
CL1019  PREDICTED:         6
CL1019  hypothetical       1
CL1019  uncharacterized    1
CL10246 predicted          1
CL10246 unnamed            6
CL1064  octicosapeptide/Phox/Bem1p  2
CL1064  serine/threonine   4
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T10:07:00+00:00Added an answer on June 14, 2026 at 10:07 am

    You can use plyr and arrange. All you are doing is ordering first by one column, then the next

    library(plyr)
    
    arrange(DF,geneID, Nr.annotation)
    

    (on second looking, your example output does not quite make sense. How are you getting a combination of

    CL1002 PREDICTED:

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: HTML5 local storage sort I am storing data into a localstorage using
Possible Duplicate: How to sort a dataframe by column(s) in R Here is the
Possible Duplicate: How to sort a dataframe by column(s) in R I was just
Possible Duplicate: How to sort a dataframe by column(s) in R I am trying
Possible Duplicate: Sort NSArray of date strings or objects Hello, I want to sort
Possible Duplicate: Sort list using stl sort function The C++ standard library gives strict
Possible Duplicate: How to sort by previous date in database? I want to do
Possible Duplicate: SQL Server Random Sort I guess it sounds stupid but I want
Possible Duplicate: Python: sort a part of a list, in place I want to
Possible Duplicate: How to sort in-place using the merge sort algorithm? Usually we take

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.