AddSignificanceHighlightingToDataTable | R Documentation |
AddSignificanceHighlightingToDataTable
Add red and blue highlighting to a data table conditionally on the values in a specified column. Used to replicate Q's significance highlighting in the table.
AddSignificanceHighlightingToDataTable(
dt,
columns.to.color,
column.to.check,
red.value,
blue.value
)
dt |
An HTML widget DataTable created e.g. by
|
columns.to.color |
A character vector containing the column names of the columns that should be colored. |
column.to.check |
The name of the column whose values will be used to do the coloring. |
red.value |
A number specifying the upper bound for values in
|
blue.value |
A number specifying the lower bound for coloring cells blue, as above. |
my.df <- data.frame(First = c(1,2,3), Second = c("a", "b", "c"))
my.dt <- DataTableWithRItemFormat(my.df, caption = "A nice table")
my.dt <- AddSignificanceHighlightingToDataTable(my.dt,
columns.to.color = "Second", column.to.check = "First",
red.value = 1.01, blue.value = 2.99)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.