Learn R Programming

examly (version 0.2.0)

color_badge: Create a colored HTML span badge (UI helper)

Description

Generates a colored HTML badge for displaying values (like p-values or correlations) in the Shiny UI.

Usage

color_badge(v, type = c("generic", "p", "r"))

Value

An htmltools::span() object.

Arguments

v

The numeric value to display.

type

The type of value ('generic', 'p', 'r') for coloring rules.

Examples

Run this code
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