heatMaps: Plot a heat map of selected variables

Description Usage Arguments Value Author(s) Examples

View source: R/heatMaps.R

Description

This function creates a heat map for a data set based on a univariate or frequency ranking

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
	heatMaps(variableList=NULL,
	         varRank = NULL,
	         Outcome,
	         data,
	         title = "Heat Map",
	         hCluster = FALSE,
	         prediction = NULL,
	         Scale = FALSE,
	         theFiveColors=c("blue","cyan","black","yellow","red"),
	         outcomeColors = c("blue","lightgreen","yellow","orangered","red"),
	         transpose=FALSE,
	         ...)

Arguments

variableList

A data frame with two columns. The first one must have the names of the candidate variables and the other one the description of such variables

varRank

A data frame with the name of the variables in variableList, ranked according to a certain metric

Outcome

The name of the column in data that stores the variable to be predicted by the model

data

A data frame where all variables are stored in different columns

title

The title of the plot

hCluster

Logical. If TRUE, variables will be clustered

prediction

A vector with a prediction for each subject, which will be used to rank the heat map

Scale

An optional value to force the data normalization outcome

theFiveColors

the colors of the heatmap

outcomeColors

the colors of the outcome bar

transpose

transpose the heatmap

...

additional parameters for the heatmap.2 function

Value

dataMatrix

A matrix with all the terms in data described by variableList

orderMatrix

A matrix similar to dataMatrix, where rows are ordered according to the outcome

heatMap

A list with the values returned by the heatmap.2 function (gplots package)

Author(s)

Jose G. Tamez-Pena and Antonio Martinez-Torteya

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
	## Not run: 

		library(rpart)
		data(stagec)

		# Set the options to keep the na
		options(na.action='na.pass')
		# create a model matrix with all the NA values imputed
		stagecImputed <- as.data.frame(nearestNeighborImpute(model.matrix(~.,stagec)[,-1]))

		# the simple heat map
		hm <- heatMaps(Outcome="pgstat",data=stagecImputed,title="Heat Map",Scale=TRUE) 

		# transposing the heat-map with clustered colums
		hm <- heatMaps(Outcome="pgstat",data=stagecImputed,title="Heat Map",Scale=TRUE,
					   transpose= TRUE,hCluster = TRUE,
					   cexRow=0.80,cexCol=0.50,srtCol=35) 

		# transposing the heat-map with reds and time to event as outcome
		hm <- heatMaps(Outcome="pgtime",data=stagecImputed,title="Heat Map",Scale=TRUE,
					   theFiveColors=c("black","red","orange","yellow","white"),
					   cexRow=0.50,cexCol=0.80,srtCol=35) 
	
## End(Not run)

Example output

Loading required package: Rcpp
Loading required package: stringr
Loading required package: miscTools
Loading required package: Hmisc
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2

Attaching package: 'Hmisc'

The following objects are masked from 'package:base':

    format.pval, units

Loading required package: pROC
Type 'citation("pROC")' for a citation.

Attaching package: 'pROC'

The following objects are masked from 'package:stats':

    cov, smooth, var

..............

FRESA.CAD documentation built on Jan. 13, 2021, 3:39 p.m.