Follow up Heatmap question Creating a heatmap / ordering columns for yearly data in R
The rownames change but my data does not change with this, can I ask for any help on how to have each respective row of data move with it's name?
Is there an easier way to make the graph / png wider as I have been messing around with the margins and all I seem to do is make it narrower.
I've attached a second image to show when I highlight a particular cell e.g. Skin Diseases in Jan a different value to what is in the .csv file, is this right? (Seeing as the colors match up should I just run with it?)
library(heatmaply) x <-read.csv("Heatmap.csv", check.names = FALSE)
rownames(x) <- c('All Others', 'Circulatory Diseases', 'Digestive Diseases', 'Ear Diseases', 'Endocrine/Metabolic','Eye Diseases', 'Genitourinary Diseases', 'Ill-defined Condition', 'Infectious & Parasitic', 'Injury/ Poisoning', 'Mental & Behavioural', 'Musculoskeletal', 'Neoplasms', 'Nervous System', 'Pregnancy/Childbirth', 'Respiratory', 'Skin Diseases') x <- x[,2:13, drop=FALSE] x <- as.matrix(scale(x)) heatmaply(x,colors = heat.colors(200), k_col =1, k_row = 2, dendrogram = FALSE, margins = c(100, 160), scale_fill_gradient_fun = ggplot2::scale_fill_gradient2(low = "blue", high = "red", midpoint = 50, limits = c(0, 100)))