PGE.prepare(ProGenExpress) | R Documentation |
Manipulates various vectors and data frames into the correct order and converts to a matrix
PGE.prepare(d = NULL, rev = FALSE)
d |
a data frame or vector |
rev |
whether or not to reverse the elements of d |
This is a utility function to manipulate either vectors or data frames into a matrix and return
in the correct format and order for passing to PGE.barplot
. Many of the arguments to
PGE.barplot
expect matrices, but much of the data ProGenExpress deals with is in data
frames. Depending on the arguments and the type of data that is passed to the function, the data
may be converted to a matrix, transposed and/or reversed.
If rev=TRUE and data is a data frame, then column order is preserved but data within each column is reversed
A matrix
You should never have to call this directly
Michael Watson
# get some random data - a vector d <- rnorm(10) # the effects of the rev argument on a vector PGE.prepare(d) PGE.prepare(d,rev=TRUE) # get some more random data and make into a data frame d2 <- cbind(d,rnorm(10)) colnames(d2) <- c("d","d2") # the effects of the rev argument on a data frame PGE.prepare(d2) PGE.prepare(d2,rev=TRUE)