Is there a R function to update my Flexdashboard in real time, without rerunning the Rmd

I have a dataset stored in my directory in excel. It gets updates every second. I have a below rmd code written to read my excel file every second. But here only time is changing and my other function is not changing. For the reference basically my dataset is like below (Col B gets changes every second)

   data1 <-
Col A    Col B
 d          3
 fd         4
 fd         5

Rmd code I have written below

   ---
 title: "Untitled"
 output: 
 flexdashboard::flex_dashboard:
 orientation: columns
 vertical_layout: fill
 runtime: shiny
 ---

 ```{r setup, include=FALSE}
 library(flexdashboard)
 ```

 Column {data-width=650}
 -----------------------------------------------------------------------

 ### Chart A

 ```{r}
 verbatimTextOutput("time")
 output$time <- renderPrint({
 invalidateLater(1000)
 Sys.time()
 })
 ```

 Column {data-width=350}
 -----------------------------------------------------------------------

 ### Chart B

 ```{r}
 verbatimTextOutput("sum1")
 data1 <- reactiveFileReader(intervalMillis = 5000,session = session,filePath = 
 "D:/Analytics/R Programming/Flex/New Microsoft Excel Worksheet.xlsx") 
 output$sum1 <- renderPrint({
 sum(data1$Col B)
 })
  ```

Hi @vinayprakash808. I cannot repeat your code. But I think you may miss the blanket after data1 because the reactiveFileReader return a reactive expression. You may try to change sum(data1$Col B) to sum(data1()$Col B). Hope it can help.

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.