box_vis: Generate a box's visualisation

View source: R/shiny_functions.R

box_visR Documentation

Generate a box's visualisation

Description

Function for generating a visualisation for a box's selected options

Usage

box_vis(
  var,
  box_type = "primary",
  tol = NA,
  match_string = NA,
  shade_label = NA,
  shade_relative = TRUE,
  cat_vis = NA,
  df = lexopsdata::lexops
)

Arguments

var

Character vector specifying which variable is selected

box_type

Which type of box is it? (one of: "primary", "warning", "success", "danger", and "info")

tol

The area which should be highlighted. Can be a numeric vector of length two, a character vector of acceptable categories, or a list of such vectors. Each item in a tol list specifies one level.

match_string

If the variable is being matched for, which string is it relative to. Leave as NA if not a matching box.

shade_label

A character vector specifying what to label the levels. Order should match that of tol. Leave as NA if not doing a split.

shade_relative

If TRUE, the value of tol is taken to be relative to the value for match_string. If FALSE, the raw values of tol are used. If match_string is not defined, shade_relative has no effect. Default is TRUE.

cat_vis

which category should be highlighted (if a categorical variable)? Can be one of tol or match_string_val.

df

A dataframe. Default is lexops.

Value

A ggplot2 or ggwordcloud object with the required visualisation.


LexOPS documentation built on Dec. 1, 2026, 5:06 p.m.