Order Rows & Columns of Heatmap in R (2 Examples) | Manual & Without Dendrogram | heatmap() Function

preview_player
Показать описание
R code of this video:

my_mat <- matrix(rnorm(25, 0, 10), nrow = 5) # Create example matrix
colnames(my_mat) <- paste0("col", 1:5) # Specify column names
rownames(my_mat) <- paste0("row", 1:5) # Specify row names
my_mat # Print example matrix

heatmap(my_mat) # Draw default heatmap

heatmap(my_mat, # Draw heatmap without dendrograms
Rowv = NA,
Colv = NA)

Follow me on Social Media:

Рекомендации по теме
Комментарии
Автор

Hey! Thanks for the short and simple video!

Do you have any idea of how to order the rows of the heatmap in descending order? (given that the rows are called 1, 2, 3... etc.)

dagurorisson
welcome to shbcf.ru