to_rankings.Rd
This function converts a matrix of ranks into a matrix of rankings (i.e., orderings), potentially including reviewer assignments as an attribute of the ranking matrix. Additionally, it can be used to add an assignments matrix to an existing matrix of rankings.
to_rankings(ranks, assignments = NULL, rankings = NULL)
A matrix or vector of ranks, such that the (i,j) entry includes the rank given by judge i to proposal j.
NA
is used to indicate that no rank was assigned to a proposal, which may occur for two reasons: (1)
If the assignments
matrix is not specified or the (i,j) entry of assignments is TRUE
, then an NA
indicates that
a proposal was considered worse than all ranked proposals. (2) If the (i,j) entry of assignments
is FALSE
, then NA
indicates that a proposal was not considered by the judge and no information can be gleaned from the missing rank.
A matrix of booleans, such that the (i,j) entry is TRUE
if judge i was assigned to review proposal j, and
FALSE
otherwise. If assignments
is NULL
, we assume all judges considered all proposals.
A matrix or vector of rankings. If a matrix, there should be one ranking per row.
A matrix of rankings, with one row per ranking. If assignments
argument is specified, then the rankings matrix will have
the attribute "assignments".
ranks <- matrix(data=c(4,2,3,1,NA,1,2,3,NA,NA,1,NA),byrow=TRUE,nrow=3)
assignments=matrix(TRUE,byrow=TRUE,nrow=3,ncol=4)
to_rankings(ranks=ranks)
#> [,1] [,2] [,3] [,4]
#> [1,] 4 2 3 1
#> [2,] 2 3 4 NA
#> [3,] 3 NA NA NA
to_rankings(ranks=ranks,assignments=assignments)
#> [,1] [,2] [,3] [,4]
#> [1,] 4 2 3 1
#> [2,] 2 3 4 NA
#> [3,] 3 NA NA NA
#> attr(,"assignments")
#> [,1] [,2] [,3] [,4]
#> [1,] TRUE TRUE TRUE TRUE
#> [2,] TRUE TRUE TRUE TRUE
#> [3,] TRUE TRUE TRUE TRUE
to_rankings(assignments=matrix(TRUE,nrow=1,ncol=3),rankings=c(3,2,1))
#> [,1] [,2] [,3]
#> [1,] 3 2 1
#> attr(,"assignments")
#> [,1] [,2] [,3]
#> [1,] TRUE TRUE TRUE