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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T04:07:25+00:00 2026-05-21T04:07:25+00:00

If one has 4 judges and they each give a score for a particular

  • 0

If one has 4 judges and they each give a score for a particular performer or a particular topic then one could have 4 vectors with each containing the score.
But one would like to turn that into a rank to overcome grade inflation by one judge compared to another.
that is easy

transform(assignment,judge1.rank=rank(judge1),judge2.rank=rank(judge2),
                     judge3.rank=rank(judge3), judge4.rank=rank(judge4))

But then for each row (performer or topic) I want another four columns that for each row states the rank of ranks (or parallel rank) for each judge.

I would like to do something such as

prank(judge1.rank,judge2.rank,judge3.rank,judge4.rank)

I guess it would have to output as a dataframe.

I thought of using the reshape package to melt the data but that is just a preliminary thought.

  • 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-05-21T04:07:26+00:00Added an answer on May 21, 2026 at 4:07 am

    If I understand you correctly, this will do what you want:

    ## example data
    set.seed(1)
    judge <- data.frame(judge1 = sample(1:10), judge2 = sample(1:10),
                        judge3 = sample(1:10), judge4 = sample(1:10))
    

    We compute the ranks for each judge using sapply() which returns a matrix of ranks. Then we use apply rank() on the rows of this matrix to compute the performer/row ranks. A final transpose gets the result back in the required orientation.

    > t(apply(sapply(judge, rank), 1, rank))
          judge1 judge2 judge3
     [1,]    1.5    1.5    3.0
     [2,]    3.0    1.5    1.5
     [3,]    1.0    2.5    2.5
     [4,]    2.0    3.0    1.0
     [5,]    1.0    2.0    3.0
     [6,]    2.5    1.0    2.5
     [7,]    3.0    2.0    1.0
     [8,]    3.0    1.0    2.0
     [9,]    3.0    1.0    2.0
    [10,]    1.0    3.0    2.0
    

    Wrap that in a function and you are good to go:

    prank <- function(df, ...) {
        t(apply(sapply(df, rank, ...), 1, rank, ...))
    }
    

    Which gives:

    > prank(judge)
          judge1 judge2 judge3
     [1,]    1.5    1.5    3.0
     [2,]    3.0    1.5    1.5
     [3,]    1.0    2.5    2.5
     [4,]    2.0    3.0    1.0
     [5,]    1.0    2.0    3.0
     [6,]    2.5    1.0    2.5
     [7,]    3.0    2.0    1.0
     [8,]    3.0    1.0    2.0
     [9,]    3.0    1.0    2.0
    [10,]    1.0    3.0    2.0
    

    The ... allows arguments to rank() to be passed in, for example the ties.method argument:

    > prank(judge, ties = "min")
          judge1 judge2 judge3
     [1,]      1      1      3
     [2,]      3      1      1
     [3,]      1      2      2
     [4,]      2      3      1
     [5,]      1      2      3
     [6,]      2      1      2
     [7,]      3      2      1
     [8,]      3      1      2
     [9,]      3      1      2
    [10,]      1      3      2
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

One has txtDateReceived and second has txtVendorPackDate. Before insert will add record I have
This one has been driving me nuts. I have a div that has it's
This one has really got me confused: I have a group of 'items' and
This one has me perplexed. I have a web app that does many functions,
This one has me stumped. I have two Windows installations of PHP: 32-bit on
I have two data structures in Java: One is called DebateAssignment and has 5
This one has been giving me fits for over an hour... I could swear
This one has really got me stumped. I have certain forms that are being
Suppose one has about 50,000 different .cpp files. Each .cpp file contains just one
This one has me pretty rattled so I thank you in advance for your

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.