shiny_events: Generic event implementation

Description Usage Arguments Value Examples

View source: R/shiny_events.R

Description

Customize the output or add a new target file (beyond CSV, log or Database). To do that, override the 'event()' function after assigning it to a variable.

Usage

1

Arguments

app

The name of the app. Defaults to the name of the script's containing folder.

Value

An environment variable containing: a GUID, the name of the app, entry() function and event() function.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
file_name <- tempfile(fileext = "txt")
tracker <- shiny_events("example-app")
tracker$event <- function(activity = "", value = "") {
  entry <- tracker$entry(activity = activity, value = value)
  cat(
    paste(
      entry$guid, entry$datetime, entry$app, entry$activity, entry$value, "\n", sep = "|"
    ),
    file = file_name, append = TRUE
  )
}
tracker$event("slider", "10")
readLines(file_name)

edgararuiz/shinyevents documentation built on Nov. 4, 2019, 11:33 a.m.