为Shiny App创建桌面图标 [英] Creating a desktop icon for Shiny App

查看:141
本文介绍了为Shiny App创建桌面图标的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我在基本R提示符下提供以下代码时,我有一个闪亮的应用程序在浏览器中打开:

I have a shiny app that opens in the browser when I provide the following code in the base R prompt:

shiny::runApp("C:/Myapp")

我使用Windows7。我正在尝试创建一个桌面图标,以避免我的客户每次想使用该应用时都键入上面的代码。我创建了一个桌面图标,并在目标中设置了路径,如下所示:

I use windows 7. I am trying to create a desktop icon to avoid my client typing the above code every time he wants to use the app. I have created a desktop icon and the set the path in "Target" as follows:

"C:\Program Files\R\R-3.2.2\bin\R.exe" -e "shiny::runApp("C:\Myapp") 

,在开始于框中,我已经包括了

and in the "start in" box I have included

"C:\Myapp"

应用程序未打开。我尝试将\更改为/ in C:/ Myapp-不起作用。但是,当我尝试以下操作时:

The app is not opening. I have tried changing the \ to / in C:/Myapp - doesn't work. However, when I try the following:

"C:\Program Files\R\R-3.2.2\bin\R.exe" -e "shiny::runApp()

,即不引用我的应用程序文件夹,而是运行rhe R程序,加载代码 shiny :: runApp()并显示消息

that is, without referring to my app folder, rhe R program runs, loads the code shiny::runApp() and prints the message

Listening on http://127.0.0.1:4354

有人可以帮助解决此问题吗?我已经尝试了上述方法的各种组合。

Can someone help on how to resolve this? I have tried various combinations of the above.

推荐答案

首先,如果您的应用程序文件夹为 C:\Documents\myApp ,那么您的工作目录应为 C:\Documents(要插入开始于框中)。

First, if your app folder is "C:\Documents\myApp", then your working directory should be "C:\Documents" (to insert in "start in" box).

第二,在内部引号中使用'' :
C:\Program Files\R\R-3.2.2\bin\R.exe -e shiny :: runApp('C:/ Myapp ')

Second, use ' ' for your inner quotes: "C:\Program Files\R\R-3.2.2\bin\R.exe" -e "shiny::runApp('C:/Myapp')"

第三,考虑使用runApp命令启动浏览器。否则,可能看不到任何东西。 ( shiny :: runApp(’C:/ Myapp’,launch.browser = TRUE)

Third, consider launching your browser with your runApp command. Otherwise there might be nothing to see. (shiny::runApp('C:/Myapp', launch.browser = TRUE))

这篇关于为Shiny App创建桌面图标的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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