【发布时间】:2017-06-21 12:35:43
【问题描述】:
我在运行 R 2.15.3 的 RStudio 中安装了 Shiny。
我通过library(shiny) 加载包
但是当我尝试使用 shinyApp 命令时,我会得到以下
library(shiny)
ui <- fluidPage()
server <- function(input,output){}
shinyApp(ui=ui,server=server)
Error: could not find function "shinyApp"
甚至当我尝试使用 R 帮助时:
?shinyApp
答案是:
No documentation for ‘shinyApp’ in specified packages and libraries:
you could try ‘??shinyApp’
而且非常令人失望,因为此命令是您一直需要的基本命令之一!
我不得不提一下,我尝试编译的示例代码来自shiny(shiny.rstudio.com/tutorial)的官方教程!所以基本上它应该可以工作。
有人可以帮我解决这个问题吗!
【问题讨论】:
-
只是猜测,但您可能想要安装最新的 R 版本?见r-project.org
-
根据文档,[cran.r-project.org/web/packages/shiny/shiny.pdf],
These functions create Shiny app objects from either an explicit UI/server pair ( shinyApp ), or by passing the path of a directory that contains a Shiny app ( shinyAppDir ). You generally shouldn’t need to use these functions to create/run applications; they are intended for interoperability pur- poses, such as embedding Shiny apps inside a knitr document -
您看不到文档,因为您使用大写字母编写应用程序。使用 ?shinyApp 代替 ?shinyAPP
-
您使用的是什么版本的闪亮?请与
sessionInfo()联系。在旧版本中,我认为它曾经被称为runApp()。您使用的是相当旧的 R 版本,因此您可能无法安装最新版本的软件包。 -
我已将 R 更新为 3.4.0 ,但我仍然遇到同样的问题,并且它出现在 Windows 上。当我使用mac编译它时,它可以正常工作!