gg_value_box: Create a Value Box for Reports

View source: R/gg_value_box.R

gg_value_boxR Documentation

Create a Value Box for Reports

Description

This function creates a value box for use in reports.

Usage

gg_value_box(values, information, icons)

Arguments

values

A vector of numeric values to be displayed in the value box.

information

A vector of strings providing information or labels for the values.

icons

A vector of Font Awesome unicode symbols to be displayed as icons.

Details

This function creates a value box with customizable values, information, and icons. The function takes inputs for the values, information, icons, and color of the value box. The values and information are provided as vectors, while the icons are specified using Font Awesome unicode symbols. The color of the value box can be customized using a factor variable. The resulting value box is a ggplot2 object that can be further customized or combined with other plots or elements in a report.

Value

A ggplot2 object with a value box for report use.

References

Modified from Stack Overflow post: https://stackoverflow.com/questions/47105282/valuebox-like-function-for-static-reports

Examples

# Create a value box with custom values and icons
gg_value_box(
  values = c(100, 500, 1000),
  information = c("Sales", "Revenue", "Customers"),
  icons = c("\U0000f155", "\U0000f155", "\U0000f0f7")
)

carbonr documentation built on Oct. 17, 2024, 1:06 a.m.