DataStorageLogFile | R Documentation |
JSON
Log FileImplementation of the DataStorage
R6 class to a JSON
log file backend using a unified
API for read/write operations
shiny.telemetry::DataStorage
-> DataStorageLogFile
event_bucket
string that identifies the file path to store user related and action data
new()
Initialize the data storage class
DataStorageLogFile$new(log_file_path)
log_file_path
string with path to JSON
log file user actions
clone()
The objects of this class are cloneable with this method.
DataStorageLogFile$clone(deep = FALSE)
deep
Whether to make a deep clone.
log_file_path <- tempfile(fileext = ".txt")
data_storage <- DataStorageLogFile$new(log_file_path = log_file_path)
data_storage$insert("example", "test_event", "session1")
data_storage$insert("example", "input", "s1", list(id = "id"))
data_storage$insert("example", "input", "s1", list(id = "id2", value = 32))
data_storage$insert(
"example", "test_event_3_days_ago", "session1",
time = lubridate::as_datetime(lubridate::today() - 3)
)
data_storage$read_event_data()
data_storage$read_event_data(Sys.Date() - 1, Sys.Date() + 1)
file.remove(log_file_path)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.