从快捷方式 Windows 10 运行 Shiny App [英] Run Shiny App from Shortcut Windows 10
问题描述
我正在尝试在桌面上创建一个快捷方式来运行 Shiny 应用程序.我一直在创建一个批处理文件来执行此操作,在网上搜索后,我仍然无法让它工作.
I'm trying to create a shortcut on the desktop to run a Shiny app. I am stuck on creating a batch file to execute this and after scouring the web, I still haven't been able to get it to work.
我使用的是 Windows 10.
I am on Windows 10.
目前我在桌面上有一个名为test"的文件夹,里面有内容:
At the moment I have a folder on the desktop called "test" with contents:
ui.R
server.R
run.R
test.bat
在 test.bat 中,我有:R.exe 的路径" CMD BATCH我的 r 脚本的路径"
Within test.bat, I have:
"path to R.exe" CMD BATCH "path to my r script"
我双击 test.bat,它在关闭前闪烁一个窗口.
I double click on test.bat, and it flashes a window before closing.
我怎样才能让它工作?预先非常感谢您.
How can I get this to work? Thank you very much in advance.
推荐答案
可能你已经解决了,但对于有同样问题的人,我发布了对我有用的内容.我创建了一个这样的 .bat 文件:
Probably you have solved it, but for someone who has the same question, I'm posting what worked for me. I created a .bat file like this:
"path/to/R.exe" -e "shiny::runApp('path/to/shinyAppFolder', launch.browser = TRUE)"
但我认为这也有效:
"path/to/R.exe" -e "path/to/run.R"
您始终可以在批处理文件中添加带有 pause
命令的行,以便您可以查看脚本出了什么问题
You can always add a line with the pause
command to your batch file so you can see whats going wrong with the script
希望能帮到你
这篇关于从快捷方式 Windows 10 运行 Shiny App的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!