Flextable knit well in .docx locally but on shiny app deployed not - r

I have a shiny app that run some statistical tests and export as .docx (word document) with RMarkdown. I found out that the best way to handle tables is with flextable and pander
When I was trying to make flextable work I realized that my RStudio were utilizng an older version from pander and I manually needed to install a new version from pander (and made it work).
So all my tables works fine when testing locally, but when I deploy my app in shinyapps.io my tables in the word document looks like raw code (image below)
MY GUESS is: probably the versions I'm using in my RStudio locally are newer and handle properly my tables, and the versions on shinyapps.io are older. Could be that?
On the future I'm gonna put my shiny app in a Digital Ocean Droplet, and there I'll install all the newest versions that I need. That would solve my problem?
If you guys agree with me I'm willing to start paying Digital Ocean just to test this, but would like some feedback that this could solve my problems.
Thanks!

Solved my problem, my guess was right!
To know the shinyapps.io pando version I've used pandoc_version() from package rmarkdown, and I got 2.3.1 (older than mine local that is 2.7.3)
So I downgraded my local pandoc version to 2.6 (just to test out a not so old version). This got me the same problem with shinyapps.io (raw xml)
To test out again, I upgraded my local pandoc to 2.7.3 again e tested again. Guess what? All is working fine.
My problem is the pandoc version from shinyapps.io, and this will be handled when I deploy my own Rstudio server (with the newest pandoc version).
Thanks all!
Notice that: to make these tests, I didn't change NOTHING in my RMarkdown file.

Related

Why would R Shiny app run indefinitely in R Studio?

I wanted to learn how to build Shiny Apps in R so I started this beginner-level tutorial. However, when I run the app on my desktop (Windows 10 x64, 16GB RAM, 500 GB SSD, i5-3470 CPU, Dual Display) in R Studio 1.3.1093) using R 4.0.3, it loads indefinitely with no error output. I tried running even the basic built-in examples (which you could find here) and they also failed to load. The exact same scripts and examples run on my laptop (Windows 10 x64, 8GB RAM, 250 GB SSD; R & R Studio specs the same) without issue. I've reinstalled the shiny package, reinstalled R and R Studio, and changed whether the app runs internally or externally with no success. I did find this post which seems to have encountered the same issue, but with no solution.
I know it's not much to go on, but I'm at a loss as to the next thing I should check. Any suggestions?
I figured out from this mostly unrelated post that there was a file at the path C:/ Users/.../Documents\R\win-library\4.0/ called 00LOCK which was giving R trouble downloading and updating new packages. I'm not sure how it got there or why R was not telling me there were issues in updating the packages, but the shiny app seems to work perfectly fine now.

Deploying shiny app to shinyapp.io with a package not on CRAN or Github

I am trying to deploy my shiny app but it is failing because RDCOMClient is not on CRAN or Github. Well to clarify a version of RDCOMClient is on Github at here but this version does not appear to work with my version of R. I downloaded the binary of the package from here and my app works fine locally.
Possible solutions I have seen or thought of are
Somehow take the binaries from the non-github address and put them on my own github then load the library from my own Github account to have my app deploy properly.
Rollback my version of R to be compatible with the RDCOMClient found at omegahat's github
Find a different library than RDCOMClient to work in its place.
Option #1 - I am unsure of how to put the binaries on Github since R looks for a specific folder/file structure when it pulls in packages from Github.
Option #2 - This seems pretty straight-forward but I worry that some of the other packages or code may not work with an earlier version. Also if someone could link to how to rollback your version of R it would be much appreciated.
Option #3 - I am using RDCOMClient to connect to Outlook and launch a draft email. If someone knows of another package that does something similar to this then this would be a viable solution.
I am of course open to other solutions to this problem and anything that could help would be much appreciated.

Is shiny dependent on having Rstudio?

I am trying to develop an shiny app, it works on my PC and not on my office server. The IT person at my office said that it is because the shiny depends on having Rstudio which they cannot install.
Therefore, I uninstalled my Rsudio to test if it works without the Rstudio. It did work and now I am asking to make sure that shiny is not dependent on having Rstudio.
Also, I can't find the R dependency of the shiny also. Does it need to be >R.3.2.5?
edited:
To clarify, this is the simple example from the shiny tutorial. It looks like this in my PC (without having shiny). I don't know how to check if I have any shiny server installed?!!!
And this is how it looks like when I try the same code on our server (R version is R/3.2.2)
Thanks

shiny red hat enterprise linux 5.8 specific issue

Is there a known issue with Red Hat Enterprise Linux 5.8 and shiny install? I have R and shiny code working on multiple PCs and Mac OS. My Linux farm IT/SysAdmin person says the R and shiny packages installed properly (I'm at his mercy for installs.) I can run other R packages he installed.
But when I
runApp()
from a R prompt, the browser fires-up and input widgets and non-reactive things show up, but output from reactive and render blocks do not appear. There are no traceback or error messages in R console.
This behavior is the same for demonstration shiny code from Rstudio.
I can't try URL examples served from shiny-server sites to see if those work because external webpage browsing is turned off in this system. Thanks.
My support IT person did not give me full details, but he said he needed to recompile some of the base OS packages and install in a separate location, then upgrade to Firefox 12. It now works.

Cannot Change the Version of R in RStudio

My RStudio (V 0.99.491) is inept to change the R Version.
I act in the ordinary way through Global Options --> R-Version. Afterwards it hangs and doesn't work or react any more. The initial version of R which works fine is R 3.1.0. I have never had such a problem before. Maybe someone has faced with a similar problem.
I tried to uninstall RStudio, and install it again, but this hasn't help to fix the issue.
I have had the same problem. Using my user account RStudio hangs up trying to change the version. All other accounts work fine.
I have located the problem in the folder C:\Users\myaccount\AppData\Roaming\RStudio\ and renamed this folder. After this everything worked fine.
I assume the problem was the file "desktop.ini.lock", because in the new folder RStudio generated, this file is missing.

Resources