Description Usage Arguments Author(s) References Examples
heatmap1
This function Function creates a correlation heatmap
using ggplot2 given a data.frame or matrix.
1 2 3 |
df |
A data.frame or matrix containing only numeric data. |
type |
Identify df to be 'matrix'(default) or 'data'. |
df.label |
A matrix for heatmap labels. |
gtitle |
legend title. |
Nbreaks |
A number controls legend breaks. |
Sig |
Logical, if TRUE put pvalue and sig level for heatmap labels. |
order |
Logical, if TRUE reorder correlation matrix. |
theme.1 |
A theme setting for ggplot2. |
data.only |
Logical, if TRUE returns correlation and pvalue. |
Yuanzhen Lin <yzhlinscau@163.com>
Yuanzhen Lin. R & ASReml-R Statistics. China Forestry Publishing House. 2016 AAFMM website:https://github.com/yzhlinscau/AAFMM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | library(AAFMM)
mydata<-mtcars
## plot data.frame
heatmap1(mydata,type='data',Sig=FALSE,Nbreaks = 8)
heatmap1(mydata,type='data',Sig=TRUE,Nbreaks = 8)
## plot correlation matrix
mcor <- round(cor(mydata),2)
cormat <- melt(mcor)
heatmap1(cormat,Sig=FALSE,Nbreaks = 8)
heatmap1(cormat,Sig=TRUE,Nbreaks = 8)
## plot any squared matrix
set.seed(2018)
label<-matrix(runif(121),nrow=11)
label<-round(label,2)
heatmap1(label)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.