Learn R Programming

tabplot (version 0.10-1)

changeTabplot: Changes a tabplot-object...

Description

Changes a tabplot-object

Usage

changeTabplot(tab, colNames=sapply(tab$columns, function(col) col$name), flip=FALSE,
    pals=list())

Arguments

colNames
vector of names of the desired columns
flip
logical, if TRUE then the plot is flipped vertically, i.e. the row bins are reversed
pals
list of color palettes. Each list item is on of the following:
  • a index number between 1 and 16. In this case, the default palette is used with the index number being the first color that is used.
  • a palette name in

Value

Details

Function to change the order of columns, to flip, and to change the palettes of a tabplot-object.

Examples

Run this code
# load diamonds dataset from ggplot2
require(ggplot2)
data(diamonds)

# assign tableplot as tabplot object
tab <- tableplot(diamonds, plot=FALSE)
 
# modify the tabplot object: reverse order of columns and customize palette
tab <- changeTabplot(tab, colNames=names(diamonds[1:7]), pals=list("Dark2", "Pastel1", gray(seq(0,1,length.out=8))))
 
# plot modified tabplot object
plot(tab)

Run the code above in your browser using DataLab