sensible_slider_vals: Get sensible slider values

View source: R/shiny_functions.R

sensible_slider_valsR Documentation

Get sensible slider values

Description

Function for converting a numeric vector into recommended arguments for shiny::sliderInput(), for sliders in LexOPS.

Usage

sensible_slider_vals(numeric_vec, n_levels, is_tolerance = FALSE)

Arguments

numeric_vec

The numeric vector which the slider will be for.

n_levels

How many sliders are to be generated for this variable?

is_tolerance

Logical; is the slider for specifying tolerances (e.g. for matching)? Default is FALSE.

Value

A list object, containing the following reccommended argument values for shiny::sliderInput():

  • min

  • max

  • value

  • step

Examples


# for matching by frequency (e.g. control for...)
#sensible_slider_vals(LexOPS::lexops$Zipf.SUBTLEX_UK, 1, TRUE)

# for 3 levels of arousal (e.g. split by...)
#sensible_slider_vals(LexOPS::lexops$AROU.Warriner, 3)

# for filtering by word prevalence (e.g. control for...)
#sensible_slider_vals(LexOPS::lexops$PREV.Brysbaert, 1)


JackEdTaylor/LexOPS documentation built on Sept. 10, 2023, 3:09 a.m.