factorplot {compdiagTools}R Documentation

Visualize factor like data

Description

This function takes a matrix or dataframe and regards the content as factor entries. It then visualizes this matrix so that each factor level gets a unique color and a legend is plotted to the right hand side.

Usage

factorplot(pd,pointsize=7,colPalette=list())

Arguments

pd Matrix or dataframe with entires. Each row will be treated like a separate factor.
pointsize Pointsize for labels. Legend labels are 0.8 * pointsize
colPalette list of colors for each factor. Each level needs one color assigned to it. If there are any NAs in the matrix, add the color for NA as the first element of the list

Details

For factors with many levels the legend might get too big.

Value

No value returned.

Author(s)

Jochen Jäger

Examples

# show some data from a gene expression study
library(golubEsets)
library(Biobase)
factorplot(pData(golubTrain)[,c(2,4,5,7,8,9,11)])

data(CO2)
factorplot(CO2[,c(1:4)])

data(iris)
factorplot(iris[,5,drop=FALSE],pointsize=9,colPalette=list(c("#FF00FF","#FFFF00","#0F8080")))
factorplot(iris[,5,drop=FALSE],pointsize=9,colPalette=list(c("black","red","gold")))

[Package compdiagTools version 1.5.3 Index]