R: Add gradient background color to ztable

makeHeatmap {ztable} | R Documentation

## Add gradient background color to ztable

### Description

Add gradient background color to ztable

### Usage

    makeHeatmap(z, palette = "Reds", mycolor = NULL, rows = NULL,
      cols = NULL, changeColor = TRUE, reverse = FALSE, margin = 0)

### Arguments

`z` | An object of class ztable
`palette` | Name of color palette
`mycolor` | user defined color vectors
`rows` | columns to make heatmap
`cols` | columns to make heatmap
`changeColor` | Logical. Whether of not change font color automatically
`reverse` | If true, reverse the font color
`margin` | An integer. Choices are one of 0,1 and 2. 0(default), heatmap for all numeric data. 1 ; rowwise heatmap, 2: columnwise heatmap.

### Examples

    require(magrittr)
    ztable(head(mtcars)) %>% makeHeatmap
    ztable(head(mtcars)) %>% makeHeatmap(palette="YlOrRd",cols=c(1,4,6),margin=2)
    ztable(head(mtcars)) %>% makeHeatmap(rows=c(1,3,5),margin=1)
    require(moonBook)
    x=table(acs$smoking,acs$Dx)
    ztable(x) %>% makeHeatmap
    ztable(x) %>% makeHeatmap(palette="Blues")
    ztable(x) %>% makeHeatmap(mycolor=gradientColor(low="yellow",mid="orange",high="red"))

[Package ztable version 0.2.0 Index]