View source: R/makeHeatMap4CT.R
makeggHeatMap4CT | R Documentation |
ggplot2
HeatMap representation of
a contingency table (i.e., CATA data).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).
makeggHeatMap4CT( aContingencyTable, colorAttributes = NULL, colorProducts = NULL, angle.x = 70, fontSize.x = 10, face.x = "plain", fontSize.y = 15, face.y = "bold" )
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 |
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. |
a ggplot2 heatmap
Herve Abdi
# Use the example from the colorOfMusic data set data(colorOfMusic) contingencyTable <- colorOfMusic$contingencyTable aHeatMap <- makeggHeatMap4CT(contingencyTable, colorProducts = colorOfMusic$colorInformation[,2])
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.