rmarkdown::run 直接显示在浏览器中? [英] rmarkdown::run directly displayed in the web browser?

查看:32
本文介绍了rmarkdown::run 直接显示在浏览器中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试直接在网络浏览器上从 R studio 运行 Rmd 文件(rmarkdown::run,因为一些闪亮的代码),但我找不到方法.

I try to run a Rmd file (rmarkdown::run, because some shiny code) from R studio directly on the web browser and I cannot find the way.

我尝试了这个解决方案:不要打开 RStudio编织后的内部浏览器

I tried this solution: Do not open RStudio internal browser after knitting

但我不知道为什么它对我不起作用.无论如何,我一直在寻找更通用"的解决方案,例如运行"功能的选项.当我查看帮助时,我可以清楚地看到:https://www.rdocumentation.org/packages/rmarkdown/versions/1.8/topics/run

but I don't know why it does not work for me. In any case, I was looking for a more "universal" solution, like an option of the function "run". When I look at the help, I can clearly see that: https://www.rdocumentation.org/packages/rmarkdown/versions/1.8/topics/run

与渲染不同,运行不会将文档渲染为磁盘上的文件.在大多数情况下,Web 浏览器将自动启动以查看文档;有关详细信息,请参阅 runApp 文档中的 launch.browser.

Unlike render, run does not render the document to a file on disk. In most cases a Web browser will be started automatically to view the document; see launch.browser in the runApp documentation for details.

所以我试过:

rmarkdown::run("TCD.CleanR.Rmd", launch.browser = TRUE)

Error in rmarkdown::run("TCD.CleanR.Rmd", launch.browser = TRUE) : 
  argument inutilisé (launch.browser = TRUE)

(抱歉法语:D:意思是未使用的参数)

(sorry for the french :D: meaning unused argument)

我不明白为什么它不起作用???

I don't understand why it does not work ???

有人有想法吗?

非常感谢 :)

推荐答案

表示提供的参数与函数使用的任何参数都不匹配.

It means that the argument provided does not match any of the arguments used by the function.

launch.browser 不是 rmarkdown::run() 的参数,它实际上是 shiny::runApp() 的参数>.它可以通过 rmarkdown::run() 使用 shiny_args 传递,如下所示:

launch.browser is not an argument of rmarkdown::run(), it is actually an argument of shiny::runApp(). It can be passed through rmarkdown::run() by using shiny_args like so:

rmarkdown::run("TCD.CleanR.Rmd", Shiny_args = list(launch.browser = TRUE))

这篇关于rmarkdown::run 直接显示在浏览器中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆