order.by.am {UCS} | R Documentation |
Sort Rows of a Data Set by Association Scores (base)
Description
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.
Usage
order.by.am(ds, am, randomise=TRUE)
Arguments
ds |
a UCS data set |
am |
a character string giving the name of a single association
measure |
randomise |
if TRUE , ties in the ordering are broken
randomly (default). Otherwise, the tied rows are arranged according
to their id values. See below for details.
|
an integer vector of row numbers, which can be used as a row index for
the data set object
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.
read.ds.gz
, add.ranks
UCS
[Package
UCS version 0.5
Index]