PGE.prepare(ProGenExpress)R Documentation

Internal function of ProGenExpress

Description

Manipulates various vectors and data frames into the correct order and converts to a matrix

Usage

PGE.prepare(d = NULL, rev = FALSE)

Arguments

d a data frame or vector
rev whether or not to reverse the elements of d

Details

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

Value

A matrix

Note

You should never have to call this directly

Author(s)

Michael Watson

Examples


        # 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)


[Package ProGenExpress version 1.0 Index]