Calculate a ranked matrix

rankedMatrix(object, MARGIN = 2L, method = c("increasing",
  "decreasing", "bidirectional"))

Arguments

object

Object.

MARGIN

a vector giving the subscripts which the function will be applied over. E.g., for a matrix 1 indicates rows, 2 indicates columns, c(1, 2) indicates rows and columns. Where X has named dimnames, it can be a character vector selecting dimension names.

method

character(1). Rank the values in increasing, decreasing, or bidirectional order.

Note

Ties are resolved automatically by calculating the average. See the ties.method parameter in rank() for details.

See also

Examples

data(lfc, package = "acidtest") ## Increasing (negative to positive) rankedMatrix(lfc, method = "increasing")
#> contrast1 contrast2 contrast3 contrast4 #> gene1 1.0 7.0 6.0 8.0 #> gene2 2.0 4.5 8.0 6.0 #> gene3 3.0 2.0 2.0 1.0 #> gene4 4.5 1.0 4.5 7.0 #> gene5 4.5 6.0 3.0 4.5 #> gene6 6.0 4.5 4.5 2.0 #> gene7 7.0 8.0 7.0 4.5 #> gene8 8.0 3.0 1.0 3.0
## Decreasing (positive to negative) rankedMatrix(lfc, method = "decreasing")
#> contrast1 contrast2 contrast3 contrast4 #> gene1 8.0 2.0 3.0 1.0 #> gene2 7.0 4.5 1.0 3.0 #> gene3 6.0 7.0 7.0 8.0 #> gene4 4.5 8.0 4.5 2.0 #> gene5 4.5 3.0 6.0 4.5 #> gene6 3.0 4.5 4.5 7.0 #> gene7 2.0 1.0 2.0 4.5 #> gene8 1.0 6.0 8.0 6.0
## Bidirectional rankedMatrix(lfc, method = "bidirectional")
#> contrast1 contrast2 contrast3 contrast4 #> gene1 -2.0 4.0 3.0 5.0 #> gene2 -1.0 1.5 5.0 3.0 #> gene3 0.0 -1.0 -1.0 -2.0 #> gene4 1.5 -2.0 1.5 4.0 #> gene5 1.5 3.0 0.0 1.5 #> gene6 3.0 1.5 1.5 -1.0 #> gene7 4.0 5.0 4.0 1.5 #> gene8 5.0 0.0 -2.0 0.0