rm(list = ls())

runWithoutInstall <- T
ifelse(runWithoutInstall,
       sapply(list.files(path = "../R/", pattern="*R", full.names = T), source),
       library(shinypipe))

Introduction

This vignette shows different usages of creating widgets through ui.params module. See source for the call to ui.params that creates these widgets. For practical applications of ui.params, check out the basic.Rmd vignette.

Widget using ui.params

dates <- as.Date("2017-01-05") + (0:5)*3

ui.params("params", 
          unbounded.num          = list(1),
          num.with.lower.bound.0 = list(2, c(0)),
          num.with.upper.bound.6 = list(3, c(NA,6)),
          bounded.num            = list(3, c(0,10)),
          bounded.num.with.steps = list(4, c(0,10), step = 2),
          num.range              = list(c(4,6), c(0,10), step = 2),
          overidden.label        = list(2, NA, label = "Num with overidden label", width = '100%'),
          date                   = list(dates[3]),
          unbounded.date.range   = list(range(dates)),
          bounded.date           = list(dates[3], range(dates), step = 2),
          bounded.date.range     = list(dates[2:3], range(dates), step = 2),
          text                   = list("", NA, placeholder = "name"),
          text.from.options      = list("negative", c("positive", "negative")),
          multiple.selection     = list("", c("a", "b", "c", "d", "e"), multiple = T),
          feature                = list(F, label="Turn feature ON"), # Also illustrates overridding the label
          custom.widget          = list(selectizeInput, multiple = T, choices = c(2,3,5,7))
          )

Parameter output

params <- callModule(s.params, "params")
renderPrint(params())


rajkar86/shinypipe documentation built on Aug. 22, 2021, 9:48 p.m.