deploy a Rmd interactive doc with Shinyapps.io

六月ゝ 毕业季﹏ 提交于 2020-01-05 04:16:24

问题


I am trying to deploy a shiny app and am running into trouble...

I have an Rmd file, and am trying to publish this document first by running locally in Rstudio, then on web. My files are stored on my home user directory in a folder named Shiny. This has the files imported, my RMD, my shinyapps.io file, and my rsconnect file.

  • title: "Sedentary Analysis"
  • author: "Bianca Gonzalez"
  • date: "July 26, 2016"
  • output: html_document
  • runtime: shiny

When I run the rsconnect::deployApp('SedentaryAnalysis.Rmd') file I get: Document successfully deployed to https://biancagonzalez.shinyapps.io/SedentaryAnalysis/

However when I open my link, I get the error:

/home/shiny/SedentaryAnalysis does not exist.

Thanks for helping me understand this error.

Bianca G


回答1:


When you call rsconnect::deployApp('SedentaryAnalysis.Rmd'), it only deploys that one file (SedentaryAnalysis.Rmd). Your .Rmd probably has code in it that refers to other files. Those files need to be deployed too for your code to work on shinyapps.io. Here is what you need to do:

  1. Replace any absolute paths in your document with relative ones.

  2. Call rsconnect::deployDoc(...) instead of rsconnect::deployApp(...). This will tell RStudio to look for the files you use in the document and deploy them with the document.

If you're using RStudio, its Publish button will do most of this for you, so try clicking that in the toolbar.



来源:https://stackoverflow.com/questions/38777265/deploy-a-rmd-interactive-doc-with-shinyapps-io

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!