colors.byexpression(ProGenExpress)R Documentation

Create a vector of 'red' and 'green' colors (or greyscale) for use by plotrange

Description

The function creates a vector of "red" and "green" (or greyscale) colors. It calculates how many bars will be in the plot created by plotrange and returns a vector of the appropriate size. Positive numbers are assigned red (gray75) and negative numbers are assigned green (gray25)

Usage

colors.byexpression(linked = NULL, cnames = "M", greyscale = FALSE)

Arguments

linked A data.frame of numerical values
cnames The column names of linked (above) that contain numerical values to be plotted
greyscale Boolean to decide if the colors should be greyscale

Details

Value

A vector of colors

Author(s)

Michael Watson

Examples

        ## Note you do not normally have to call this function
        ## it is used internally by ProGenExpress

        data <- cbind(rnorm(10),rnorm(10))
        colnames(data) <- c("M1","M2")
        colors.byexpression(data,cnames=c("M1","M2"))
        colors.byexpression(data,cnames=c("M1","M2"),greyscale=TRUE)


[Package ProGenExpress version 1.0 Index]