order.by.am {UCS} | R Documentation |
Sort the rows of a data set according to the annotated scores of an
association measure (in descending order). Ties in the ordering are
broken randomly by default, using the random
association
measure to yield a reproducible ordering.
order.by.am(ds, am, randomise=TRUE)
With randomise=TRUE
, the data set must contain a variable named
am.random
, which is used to break ties in the ordering.
Otherwise, tied rows are arranged according to their ID values, and
the corresponding id
variable must be annotated in the data set.
The random
association measure is used for breaking ties
(rather than random numbers generated on the fly) in order to
ensure that the ordering is reproducible. If this measure has not
been annotated in a data set file, you can easily add the required
variable to a data set ds
with the command
ds$am.random <- runif(nrow(ds))You should probably use
set.seed
to ensure a reproducible ordering.
an integer vector of row numbers, which can be used as a row index for the data set object