I am trying to make a heatmap table, which is fairly easy, but I am wanting the gradient color to be confined within a single row, not over the entire data.frame. The result should be that each row should have the row max and min both present. Basically all examples of heatmaps I can find online create the gradient color scale from all values in the table.
Here is an example dataframe:
df <- data.frame('var' = paste0('var',1:3),
'group1' = c(1,500,3),
'group2' = c(2,300,1),
'group3' = c(3,100,2),
'group4' = c(4,50,4),
'group5' = c(5,10,5))