可能的重叠:
闪亮服务器
R闪亮/闪亮服务器中缺少软件包- 查找软件包的问题
R - 如何为闪亮服务器设置install.packages()的路径? - Ubuntu
我已经尝试并阅读了上述所有内容,但仍然无法让我的Shiny Server工作.
我按照http://www.rstudio.com/shiny/server/install-opensource上的安装说明进行操作,包括系统安装的闪亮包:
$ sudo su - \
-c "R -e \"install.packages('shiny', repos='http://cran.rstudio.com/')\""
Run Code Online (Sandbox Code Playgroud)
Shiny Server已正确安装并正常运行,
~# sudo start shiny-server
start: Job is already running: shiny-server
Run Code Online (Sandbox Code Playgroud)
但当我浏览到domain:3838我可以看到欢迎光泽页面,有错误
Error in eval(expr, envir, enclos) :
The Shiny package was not found in the library. Ensure that
Shiny is installed and is available in the Library of the
user you're running this application as.
Calls: local -> eval.parent …
我正在尝试使用闪亮创建一个Web应用程序.它需要我加载我在计算机上安装的软件包.例如:
## Contents ui.R:
library(shiny)
library(plyr)
shinyUI(pageWithSidebar(
headerPanel("Hello Shiny!"),
sidebarPanel(
sliderInput("obs",
"Number of observations:",
min = 0,
max = 1000,
value = 500)
),
mainPanel(
plotOutput("distPlot")
)
))
## Contents server.R:
library(shiny)
library(plyr)
shinyServer(function(input, output) {
output$distPlot <- renderPlot({
# generate an rnorm distribution and plot it
dist <- rnorm(input$obs)
hist(dist)
})
})
Run Code Online (Sandbox Code Playgroud)
如果我在本地运行它(使用runApp),但是当我尝试通过我的服务器(同一台计算机)运行它时,我得到的错误是plyr我没有安装包(或我尝试使用这种方式的任何其他包)的错误.我怎么能在闪亮的服务器中使用额外的包?