Search code examples
rshinyr-markdownflexdashboard

Page not rendering if Rmd file not changed


I have an application created with flexdashboard. I included my R code in different chunks as it supposed to be (along with shiny and flexdashboard components).

If I try to run my application ( from batch file using rmarkdown::run or directly from Rstudio, it doesn't really matter) without changing the Rmd file first (just with a space more), the application stars but the chunks are not run. Basically only the static page is shown and I see that the shiny server (my pc in this case) is in "listen" status. At this point whatever interaction I do with buttons dropdown list has no effect on the application.

It seems that the chunks are not run if the Rmd file is up to date. There is a way to force the execution? I don't understand what I'm doing wrong.

If I change with a fake modification the rmd and I save it, then all the chunks are executed and the app run perfectly....

I run my app using the following code via batch file:

"D:\Data\v101285\Programs\R\R-3.5.2\bin\i386\R.exe" -e "rmarkdown::run('D:/Data/v101285/Marco/09_R_Projects/02_InteractiveRiskViewer/InteractiveRiskViewer.Rmd', shiny_args = list(launch.browser = TRUE))"

thanks a lot for the support

Edit: For avoiding cache issues,as suggested in the comments, I included cache=FALSE in every chuck but still the issue persists. I noticed that Rmarkdown creates for every run a temp folder under "C:\Users.....\AppData\Local\Temp....\rmarkdown\". If I delete all the files than the chunks are run and the app works. There is a way to avoid this temp files?


Solution

  • I had a similar problem and i've found a solution: https://github.com/rstudio/flexdashboard/issues/108

    I just had to ensure that runtime: shiny is on its own line (not indented in the yaml header).

    title: "Dynamic UI Test"
    runtime: shiny
    output: 
      flexdashboard::flex_dashboard:
        orientation: columns
        vertical_layout: fill