Is there a way to create a similar effect to excel's conditional formating -> color scales in order to present a table in grid.table/tablegrob object? The color indicator should be red for the lower values and green for the higher values in the column. That object format is needed so the table can be presented in grid format along with plots.
Thank you.
A solution I found was to do the following.. this only works if the data is in order and you list the count of rows(17 based on your screenshot):
Hope that helps. I am also seeking for alternatives myself
You could use
tableHTML
for that:for the dataset:
You can than create an HTML table using the
tableHTML()
function. Then apply a colour rank with themeRAG
to the 2nd column of the table:The result looks like this:
The most natural solution for that is to use a
heatmap()
?Would yield a heatmap with some default color options. You can change the color using an additional parameter (e.g
col = cm.colors(256)
) or your own color palette to achieve the desired output.,
You can do this within
tableGrob
. You create a vector of colours, and then assign these to the cells.So using the data from clemens's answer: