Learn R Programming

tabplot (version 1.3-3)

tableChange: Change a tabplot-object

Description

Make layout changes in a tabplot-object, such as the order of columns, and color palettes.

Usage

tableChange(tab, select = NULL, select_string = tab$select,
  decreasing = NULL, pals = list(), colorNA = NULL, numPals = NULL)

Arguments

select

index vector of the desired columns (column names are not supported)

select_string

vector of names of the desired columns

decreasing

determines whether the dataset is sorted decreasingly (TRUE) of increasingly (FALSE).

pals

list of color palettes. Each list item is on of the following:

  • a palette name in tablePalettes, optionally with the starting color between brackets.

  • a palette vector

If the list items are unnamed, they are applied to all selected categorical variables (recycled if necessary). The list items can be assigned to specific categorical variables, by naming them accordingly.

colorNA

color for missing values

numPals

name(s) of the palette(s) that is(are) used for numeric variables ("Blues", "Greys", or "Greens"). Recycled if necessary.

Value

tabplot-object

Examples

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

# assign tableplot as tabplot object
tab <- tableplot(diamonds)
 
# modify the tabplot object: reverse order of columns and customize palette
tab <- tableChange(tab, select_string=rev(names(diamonds)), 
				   pals=list(clarity=gray(seq(0,1,length.out=8))))
 
# plot modified tabplot object
plot(tab)
# }

Run the code above in your browser using DataLab