# im_2_mat: Plot heatmaps of two matrices in red and blue In BaTFLED3D: Bayesian Tensor Factorization Linked to External Data

## Description

Displays two heatmaps of matrices using red and blue colors. Options to scale and sort as well as any other graphical parameters with ... Sorting attempts to match columns between the two matrices using their correlation over rows. If `sort==TRUE` then the new ordering for the second matrix is returned.

## Usage

 ```1 2 3``` ```im_2_mat(x1, x2, high = "red", xaxt = "n", yaxt = "n", scale = "col", absol = FALSE, sort = TRUE, center = FALSE, main1 = "", main2 = "", ...) ```

## Arguments

 `x1` matrix `x2` matrix `high` string of either 'red' or 'blue' used to show higher values `xaxt` string indicating how to display the x axis. Suppress x axis with 'n' `yaxt` string indicating how to display the y axis. Suppress y axis with 'n' `scale` logical indicating whether the matrices should be z scaled to have columns with norm zero and standard deviation one. `absol` logical indicating whether to take absolute value of the entries before plotting `sort` logical indicating whether the columns of the matrix should be sorted in decreasing order of their means `center` logical indicating wether to center ranges for x and y around zero `main1` string to be used as the main title for the first matrix image `main2` string to be used as the main title for the second matrix image `...` other graphical parameters passed to image

## Value

If `sort==TRUE` the ordering of the second matrix used to match columns.

## Examples

 ```1 2 3 4 5 6``` ```par(mfrow=c(1,2)) im_2_mat(matrix(1:12, nrow=3, ncol=4), matrix(13:24, nrow=3, ncol=4), sort=FALSE, scale=FALSE) im_2_mat(matrix(1:12, nrow=3, ncol=4), matrix(13:24, nrow=3, ncol=4), sort=TRUE, scale=FALSE) im_2_mat(matrix(1:12, nrow=3, ncol=4), matrix(13:24, nrow=3, ncol=4), sort=TRUE, scale=TRUE) im_2_mat(matrix(1:12, nrow=3, ncol=4), matrix(13:24, nrow=3, ncol=4), sort=FALSE, scale=FALSE, center=TRUE) ```

BaTFLED3D documentation built on May 2, 2019, 2:38 p.m.