powered by
Generates a colored HTML badge for displaying values (like p-values or correlations) in the Shiny UI.
color_badge(v, type = c("generic", "p", "r"))
An htmltools::span() object.
htmltools::span()
The numeric value to display.
The type of value ('generic', 'p', 'r') for coloring rules.
if (interactive()) { # Example for difficulty (p) color_badge(0.5, "p") # Example for discrimination (r) color_badge(0.2, "r") }
Run the code above in your browser using DataLab