2
votes

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?

1
Can you elaborate on your question? Right now it's not clear to me what the problem is. Normally, if you modify your code, you have to kill that session and restart it. - Roman Luštrik
I enlarge my problem description. Maybe now is more clear. Please if is it still not clear I try to include code and screenshot. Many thanks!! - Marco Rinaldo
Thank you for describing the problem in more detail. I think I understand what the problem is but I don't have a solution, sorry. Have you tried updating Rstudio, perhaps to a daily build? - Roman Luštrik
I am using the latest version of Rstudio which is compatible with R 32bit since the oracle driver of our company DB is 32bit. But if the problem was Rstudio then the application should at least run with batch. I don't know how to force chunks execution. How do you run your applications? - Marco Rinaldo
Could there any caching be happening? - Roman Luštrik

1 Answers

1
votes

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