I made a heatmap
using the viridis color scheme (packages "gplots" and "viridis"), my data is all numbers from 0.0001-0.01 for 91 participants and 21 variables
This is the code I used:
heatmap.2(responses_7m_matrix_log,
col=viridis,
trace="none",
margins= c(8, 12),
cexCol=0.6, cexRow=0.5,
Rowv=FALSE, Colv=FALSE, key=FALSE)
The heatmap looks just like I want, but I want to reverse the colors and cannot find out how to do it.
I have tried adding
scale_color_viridis(direction = -1)
but this is not working (it gives an error "non-numeric argument to binary operator"
Does anybody now how I can inverse the colors?