可以在不打开R环境的情况下运行RShiny应用程序? [英] possible to run RShiny app without opening an R environment?

查看:156
本文介绍了可以在不打开R环境的情况下运行RShiny应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当前我有一个R Shiny应用程序,要运行它,我需要打开RStudio并执行

Currently I have a R shiny app, to run it I open up RStudio and execute

setwd("C:/Users/Me/Desktop/R/ShinyProject2")
library(shiny)
......
runApp()

来自我目录中的R脚本.

From a R script located in my directory.

我正在将应用程序发送给不知道如何使用R的同事以供审核.

I am sending the app for review purposes to a co-workers who doesn't know how to use R.

所以我只是想知道...是否有一种简单的方法可以编写一个无需单击即可直接打开UI的可执行文件 打开R studio并执行代码?

So I'm just wondering ... Is there an easy way to write an executable that directly opens the UI without having to click open R studio and execute the codes?

推荐答案

RStudio!= R

RStudio != R

R有一个简单的命令行界面,可以通过在R安装的bin文件夹中运行R.exe在Windows上运行.

There is a simple command-line interface to R, which you can run on Windows by running R.exe in the bin folder of your R installation.

还有Rscript.exe,可以运行表达式或脚本文件.例如:

There's also Rscript.exe, which can run an expression or a script file. For example:

C:\Program Files\R\R-2.15.2\bin\RScript -e hist(runif(1000))

(在正确的路径下)将创建一个带有直方图的PDF文件.

will (given the right paths) create a PDF file with a histogram in it.

所以

  • 您的同事需要R安装
  • 您需要安装才能使所有程序包运行正常
  • 或者您在代码中添加一堆install.packages()行
  • 您需要为他们提供一个包含闪亮代码的文件夹
  • 您添加一个Windows .BAT文件供其单击
  • 运行它们,它会调用Rscript.exe,它会启动您给他们的闪亮包

或者将其托管在RStudio伙计们的公共闪亮服务器上,但是我们都能看到它.

Or get it hosted on the RStudio guys' public shiny server, but then we can all see it.

这篇关于可以在不打开R环境的情况下运行RShiny应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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