David Nitkin
David Nitkin

Reputation: 53

Removing labels when using Heatmap package in R

I'm trying to generate a heatmap with a ton of data (1193 rows, 165 columns) and the row and column labels are coming out completely packed together, overlapping, and ugly. Accordingly, I'd like to remove them and not display any column or row labels at all.

I'm trying to use labRow = NULL, but am getting an error message that says unused argument (labRow = NULL)

Does anyone know what I'm doing wrong, or how I can prevent the row and column labels from displaying? Below is my code.

Thanks so much!

Heatmap(filename,name="name of chart", col=colorRamp2(c(2,3,4,5,6,7,8,9),
c("firebrick4","firebrick3","firebrick1","darkorange1","gold1", "deepskyblue","dodgerblue","dodgerblue4")),
cluster_rows=FALSE,cluster_column=FALSE, labRow = NULL

Upvotes: 3

Views: 5144

Answers (5)

Jenomics
Jenomics

Reputation: 1

show_annotation_name = FALSE 

That will do the trick!

Upvotes: 0

swarn
swarn

Reputation: 49

Just set "fontsize_row" or "fontsize_col" to a small number (e.g., 0.001).

Upvotes: 0

David Nitkin
David Nitkin

Reputation: 53

I figured it out! The answer is row_names_gp = gpar(fontsize = 10)

Thanks, all!

Upvotes: 1

Joe
Joe

Reputation: 8651

I think you need to change it to labRow = FALSE and that should fix the problem.

Upvotes: 3

Winicius Sabino
Winicius Sabino

Reputation: 1506

leave empty your rownames and colnames of the filename object

empty.cols = unlist(lapply(colnames(filename),function(x){
                                            a = " "
                                        } 
                            )
                    )
empty.rows = unlist(lapply(row.names(filename),function(x){
                                            a = " "
                                        } 
                           )
                   )
colnames(filename) = empty.cols
row.names(filename) = empty.rows

or if you want to preserve filename object names use

heatmap(filename,labRow = empty.rows, labCol = empty.cols)

Upvotes: 1

Related Questions