Package 'shinyDTC'

Title: Simple Dynamic Timer Control
Description: A dynamic timer control is a Shiny widget that enables time-based processes in applications. It allows users to execute these processes manually in individual steps or at customizable speeds. The timer can be paused, resumed, or restarted. This control is particularly well-suited for simulations, animations, countdowns, or interactive visualizations.
Authors: Sigbert Klinke [aut, cre]
Maintainer: Sigbert Klinke <[email protected]>
License: GPL-3
Version: 0.1.0
Built: 2026-05-09 07:41:47 UTC
Source: https://github.com/sigbertklinke/shinydtc

Help Index


openApp

Description

Opens an example Shiny app into the RStudio editor.

Usage

openApp(dir = "mini", ...)

Arguments

dir

character: name of the app

...

further parameter given to rstudioapi::navigateToFile()

Value

invisibly the result of navigateToFile

Examples

if (interactive()) run() # runs the minimal example

resetTimer

Description

Simulates a button press for Reset.

Usage

resetTimer(inputId)

Arguments

inputId

character: input slot

Value

nothing

Examples

if (interactive()) vignette("shinyDTC")

runAppx

Description

Runs an example Shiny app via shiny::runExample().

Usage

runAppx(example = "mini", x = NULL, ...)

Arguments

example

character: name of the example to run, or NA to list the available examples

x

data frame: data to pass to the app

...

further parameter given to shiny::runExample()

Details

Note that for running a Shiny app more libraries might be necessary.

Value

invisibly the (modified) data set x

Examples

if (interactive()) runAppx() # runs the minimal example

stepTimer

Description

Simulates a button press on Step.

Usage

stepTimer(inputId)

Arguments

inputId

character: input slot

Value

nothing

Examples

if (interactive()) vignette("shinyDTC")

timer

Description

A reactive function.

Usage

timer(inputId, input, session, ...)

Arguments

inputId

character: input slot for a timer

input

an inpur object

session

a session object

...

further parameters for shiny::reactive()

Value

a reactive function which returns a counter

Examples

if (interactive()) vignette("shinyDTC")

timerInput

Description

Constructs a timer widget with a slider and two buttons.

Usage

timerInput(inputId, step1 = list(), reset = list(), ...)

Arguments

inputId

character: input slot

step1

list: list of parameters for the left (step) button

reset

list: list of parameters for the right (reset) button

...

parameters to the slider

Value

a widget to timer

Examples

if (interactive()) vignette("shinyDTC")

updateTimerInput

Description

updateTimerInput

Usage

updateTimerInput(
  session = getDefaultReactiveDomain(),
  inputId,
  step1 = list(),
  reset = list(),
  ...
)

Arguments

session

session object

inputId

id of the input object

step1

modified values for Step button, see shiny::updateActionButton()

reset

modified values for Reset button, see shiny::updateActionButton()

...

modified values for Speed slider, see shiny::updateSliderInput()

Value

nothing

Examples

if (interactive()) vignette("shinyDTC")