makeggHeatMap4CT: makeggHeatMap4CT makes a 'ggplot2' HeatMap representation of...

View source: R/makeHeatMap4CT.R

makeggHeatMap4CTR Documentation

makeggHeatMap4CT makes a ggplot2 HeatMap representation of a contingency table (i.e., CATA data).

Description

makeggHeatMap4CT makes a ggplot2 HeatMap representation of a contingency table (e.g., CATA data). makeHeatMap4CT assumes the contingency table contains only non-negative numbers. The rows of the contingency table are observations (for a CATA task: products), the columns of the contingency table are variables (for a CATA task: descriptor). Note 1: as a ggplot2 object, the map can be customized (e.g., title, x and y labels) like any ggplot2 object. Note 2: this function is still somewhat experimental (i.e., ggplot2 is not a "natural" for heatmap).

Usage

makeggHeatMap4CT(
  aContingencyTable,
  colorAttributes = NULL,
  colorProducts = NULL,
  angle.x = 70,
  fontSize.x = 10,
  face.x = "plain",
  fontSize.y = 15,
  face.y = "bold"
)

Arguments

aContingencyTable

a contingency table to be plotted

colorAttributes

color for the names of the columns. Can be one value or a vector. If NULL (default), colors are chosen using prettyGraphs::prettyGraphsColorSelection()

colorProducts

color for the names of the rows. Can be one value or a vector. if NULL use dark grey.

angle.x

(default = 70) The slope when writing the name of the variables.

fontSize.x

(default = 10), font size for the name of the variables.

face.x

(default = 'plain'), the face for the names of the variables.

fontSize.y

(default = 15), font size for the name of the products.

face.y

(default = 'bold'), the face for the names of the products.

Value

a ggplot2 heatmap

Author(s)

Herve Abdi

Examples

# Use the example from the colorOfMusic data set
data(colorOfMusic)
contingencyTable <- colorOfMusic$contingencyTable
aHeatMap <- makeggHeatMap4CT(contingencyTable,
             colorProducts = colorOfMusic$colorInformation[,2])


HerveAbdi/PTCA4CATA documentation built on July 17, 2022, 5:41 a.m.