r - Edit row and col names in Pheatmap -
i want edit row , col names in pheatmap
or delete , add new row , col names edited. in case set show_colnames
, show_rownames
false
.
library("pheatmap") pheatmap(scale(dat), show_colnames = t, show_rownames = t,legend = true, cluster_rows=f, cluster_cols=f, border_color = "grey60")
can me thanks.
you can use labels_row
, labels_col
parameters.
> set.seed(1) > mat <- matrix(rnorm(100), 10, 10, dimnames=list(letters[1:10], letters[11:20])) > pheatmap(mat)
> pheatmap(mat, labels_row=paste0("foo", 1:10), labels_col=paste0("bar", 1:10))
alternatively can modify rownames
/ colnames
of matrix pass pheatmap
function.
library(magrittr) mat %>% set_rownames(paste0("foo", 1:10)) %>% set_colnames(paste0("bar", 1:10)) %>% pheatmap()
Comments
Post a Comment