Learn R Programming

fabia (version 2.18.0)

matrixImagePlot: Plotting of a Matrix

Description

matrixImagePlot: R implementation of myImagePlot.

Usage

matrixImagePlot(x,xLabels=NULL, yLabels=NULL, zlim=NULL, title=NULL)

Arguments

x
the matrix.
xLabels
vector of strings to label the columns (default "colnames(x)").
yLabels
vector of strings to label the rows (default "rownames(x)").
zlim
vector containing a low and high value to use for the color scale.
title
title of the plot.

Details

Plotting a table of numbers as an image using R.

The color scale is based on the highest and lowest values in the matrix.

The original R code has been obtained by http://www.phaget4.org/R/myImagePlot.R and then has been modified.

References

http://www.phaget4.org/R/myImagePlot.R

See Also

fabia, fabias, fabiap, fabi, fabiasp, mfsc, nmfdiv, nmfeu, nmfsc, extractPlot, extractBic, plotBicluster, Factorization, projFuncPos, projFunc, estimateMode, makeFabiaData, makeFabiaDataBlocks, makeFabiaDataPos, makeFabiaDataBlocksPos, matrixImagePlot, fabiaDemo, fabiaVersion

Examples

Run this code


#---------------
# TEST
#---------------

dat <- makeFabiaDataBlocks(n = 100,l= 50,p = 3,f1 = 5,f2 = 5,
  of1 = 5,of2 = 10,sd_noise = 3.0,sd_z_noise = 0.2,mean_z = 2.0,
  sd_z = 1.0,sd_l_noise = 0.2,mean_l = 3.0,sd_l = 1.0)

X <- dat[[1]]
Y <- dat[[2]]

matrixImagePlot(Y)
dev.new()
matrixImagePlot(X)


## Not run: 
# #---------------
# # DEMO
# #---------------
# 
# dat <- makeFabiaDataBlocks(n = 1000,l= 100,p = 10,f1 = 5,f2 = 5,
#   of1 = 5,of2 = 10,sd_noise = 3.0,sd_z_noise = 0.2,mean_z = 2.0,
#   sd_z = 1.0,sd_l_noise = 0.2,mean_l = 3.0,sd_l = 1.0)
# 
# X <- dat[[1]]
# Y <- dat[[2]]
# X <- X- rowMeans(X)
# XX <- (1/ncol(X))*tcrossprod(X)
# dXX <- 1/sqrt(diag(XX)+0.001*as.vector(rep(1,nrow(X))))
# X <- dXX*X
# 
# matrixImagePlot(X)
# 
# ## End(Not run)

Run the code above in your browser using DataLab