Hi all,
In the below application, I am trying to capture the logging events. One strange thing I observed is, the Sys.time
and the time it is showing when I perform input$bins
is different. For example please refer below picture. The first line is the actual time(00 : 09 : 50) but the below lines is having a time that is different (18 : 39 : 50 and so on). May I know why is this happening? Can we have a actual time here?
ui.R
library(shinyEventLogger)
library(shiny)
set_logging(r_console = TRUE,js_console = FALSE,file = TRUE)
# Define UI for application that draws a histogram
shinyUI(fluidPage(
# Application title
titlePanel("Old Faithful Geyser Data"),
# Sidebar with a slider input for number of bins
sidebarLayout(
sidebarPanel(
sliderInput("bins",
"Number of bins:",
min = 1,
max = 50,
value = 30)
),
# Show a plot of the generated distribution
mainPanel(
plotOutput("distPlot")
)
)
))
server.R
library(shiny)
source("ui.R")
library(shinyEventLogger)
# Define server logic required to draw a histogram
shinyServer(function(input, output) {
set_logging_session()
log_output(Sys.time())
output$distPlot <- renderPlot({
# generate bins based on input$bins from ui.R
x <- faithful[, 2]
bins <- seq(min(x), max(x), length.out = input$bins + 1)
# draw the histogram with the specified number of bins
hist(x, breaks = bins, col = 'darkgray', border = 'white')
})
observe({
log_output(input$bins,type = "New",status = "NEWSTATUS")
})
})