View source: R/shiny_functions.R
box_vis | R Documentation |
Function for generating a visualisation for a box's selected options
box_vis(
var,
box_type = "primary",
tol = NA,
match_string = NA,
shade_label = NA,
shade_relative = TRUE,
cat_vis = NA,
df = LexOPS::lexops
)
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 |
match_string |
If the variable is being matched for, which string is it relative to. Leave as |
shade_label |
A character vector specifying what to label the levels. Order should match that of |
shade_relative |
If |
cat_vis |
which category should be highlighted (if a categorical variable)? Can be one of |
df |
A dataframe. Default is |
A ggplot/ggwordcloud object with the required visualisation.
#box_vis("CMU.PrN", "warning", c(-1, 1), "test")
#box_vis("CMU.PrN", "warning", list(c(1, 1), c(3, 3)), shade_label = c("A1", "A2"))
#box_vis("AROU.Glasgow_Norms", "info", c(-1, 0.5), match_string = "thicket")
#box_vis("Rhyme.eSpeak.br", "danger", match_string = "thicket")
#box_vis("PoS.SUBTLEX_UK", "warning", match_string = "laura", cat_vis = "match_string_val")
#box_vis("PoS.SUBTLEX_UK", "warning", tol = "noun", match_string = "laura", cat_vis = "tol")
#box_vis("PoS.ELP", "warning")
# ignore shade_label for categorical histogram?
#box_vis("PoS.SUBTLEX_UK", "warning", list("noun", "verb"), shade_label = c("B1", "B2"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.