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 7899405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:41:38+00:00 2026-06-03T08:41:38+00:00

Well, having decided to get to know some of the basic functions in R

  • 0

Well, having decided to get to know some of the basic functions in R I’ve stumbled upon the sort.list() function. I get the pretty straight forward sort() function, but don’t get the idea of the sort.list(). I’ve read that it should be a permutation function rearranging the content of my vector (in some way).

Having the vector;

x <- c(5.0, 3.0, 2.0, 2.2, 0.0, 5.0, 3.0, 2.0, 2.2)

Running sort.list(x) outputs

[1] 5 3 8 4 9 2 7 1 6

Where did that come from? Can someone give me a hint please? And what’s the use of this permutation anyway?

Thanks.

  • 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-03T08:41:39+00:00Added an answer on June 3, 2026 at 8:41 am

    sort.list, as it says at ?sort.list, is the same as order, only instead of accepting multiple arguments via ..., it accepts only one atomic vector as an argument.

    Presumably, then, it could be intended as a “faster” or “simpler” version of order.

    What good is it? Consider this:

    x <- c(5.0, 3.0, 2.0, 2.2, 0.0, 5.0, 3.0, 2.0, 2.2)
    > x[sort.list(x)]
    [1] 0.0 2.0 2.0 2.2 2.2 3.0 3.0 5.0 5.0
    > x[order(x)]
    [1] 0.0 2.0 2.0 2.2 2.2 3.0 3.0 5.0 5.0
    

    Just like order it returns a permutation that when used to index the original vector sorts it.

    But I also think the name is confusing.

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

Sidebar

Related Questions

Well, I am trying to use an element of function list.But i am having
Well. I'm having a problem with the eval(); function in PHP. I don't quite
Well, figuring such thing was easy, I decided to get a custom action executed
Hey, well I'm having a problem and this weird symbol is showing up â€
I am having a strange problem ( well, at least i find it strange
I am having trouble getting well formatted results from my mysql query. Here is
I've written an installer in WiX; and it works very well. However, I've having
Well I'm doing some Java - C integration, and throught C library werid type
I decided to modify some code today, and encountered an error that doesn't make
I don't know much about the heavy math behind cryptosystems, I get stuck when

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.