orderAttribVals: Change attribute order

Description Usage Arguments Value See Also Examples

Description

This is a convenience function that allows easy reordering of attribute values for plotting (does not affect data analysis). Bars in the wrong order? Use this function.

Usage

1
orderAttribVals(obj, attribute, order)

Arguments

obj

A valid DAM S4 object

attribute

A string that matches one of the column names from the original sample info .csv file

order

A vector with the new order of values for the attribute. Can be either a character vector with the

Value

Returns a DAM object with the attribute of concern reordered

See Also

To see the current attribute order, use listAttribVals

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# reorder by number
dat <- data(DAM_DD)
listAttribVals(DAM_DD, "genotype")
dat <- orderAttribVals(DAM_DD, "genotype", c(3, 2, 1))
listAttribVals(DAM_DD, "genotype")

# reorder by values
dat <- data(DAM_DD)
listAttribVals(DAM_DD, "genotype")
dat <- orderAttribVals(DAM_DD, "genotype", c("experimental", "control B", "control A"))
listAttribVals(DAM_DD, "genotype")

kazi11/actmon documentation built on May 20, 2019, 7:53 a.m.