How to generate rmarkdown report in Shiny as a desktop application

时间:2015-07-28 15:47:08

标签: r shiny rstudio

according to: Locally installed Shiny app I developed a Shiny application which can be distributed as a folder with a runscript and R-portable inside.

Now I implemented an export button in the shiny app, which generates a pdf file through rmarkdown. Running the shiny app from rstudio works. But running the app in the folder with runscript, the pdf export does not work.

I think I also need RStudio portable and miktex portable inside the folder, but I do not know how to link the render function in rmarkdown package to this RStudio and how does RStudio know where the miktex executable is?

I can not install RStudio and miktex locally on the other machines, so I have to distribute it with the Shiny app.

Thanks for helpful comments.

1 个答案:

答案 0 :(得分:0)

我找到了问题的解决方案。 我将pandoc文件夹从RStudio和miktex portable复制到我的桌面应用程序的主文件夹中。 其次,我将以下内容写入R-Portable(RProfile.site)中的RPortable/App/R-Portable/etc/RProfile.site

Sys.setenv(PATH=paste("C:/Program Files/Java/jdk1.8.0_05/jre/bin/server",sep=";","../pandoc/","../miktex/miktex/bin/"))

现在它在不同的机器上运行。最终只能在另一台机器上更改Java路径。

贝斯茨