stat_boxes: Generate a set of stat boxes.

Description Usage Arguments Details Value Examples

View source: R/statbox.R

Description

Generate a set of six related stat boxes that summarize the distribution of values from a data frame.

Usage

1
2
3
4
5
stat_boxes(x, type = "annual", style = "valueBox", rnd = 0, dec,
  height = "110px", width.icon = "90px", text.size = 75,
  value.size = 150, output = "boxes",
  main_title = "<h4>Aggregate period statistics</h4>",
  clrs = c("light-blue", "blue"), theme = "white")

Arguments

x

a data frame.

type

character, type of stat box set. Must be "annual" (default) or "decadal".

style

character, "valueBox" (default) or "infoBox".

rnd

decimal places to round data to for appearance in stat box (valueBox widget). Defaults to 0.

dec

character, the sorted unique values of x[["Decade"]]. Typically provided by calling function. See stat_boxes_group.

height

character, stat box height. defaults to "110px".

width.icon

character, icon image width, defaults to "90px".

text.size

numeric, scaling for text size, defaults to 75. See details.

value.size

numeric, scaling for value size, defaults to 150. See details.

output

character, "boxes" (default) or "list". A list is useful for returning raw output, e.g. for sending to a rmarkdown report.

main_title

character, typically contains html. Defaults to "<h4>Aggregate period statistics</h4>".

clrs

character, background colors of stat boxes. See details.

theme

color theme, either "white" (default) or "black".

Details

clrs must be length-one (will be repeated six times), -two (alternating colors), or -six (all colors individually specified). Colors must be provided in hex format, e.g., #FFFFFF or a valid Shiny Dashboard color. This function is typically called by stat_boxes_group but may be called directly when groups of stat boxes are not needed. text.size and value.size are length-six or length-one (repeated) vectors. Defaults are better suited to style = "valueBox" than style = "infoBox". Stat box icons are fixed images and come with the apputils package.

Value

a shiny::tagList containing a heading and a fluid row of six stat boxes.

Examples

1
#not run

leonawicz/snaputils documentation built on May 20, 2019, 10:21 p.m.