[英]Installed package (Dygraphs) not detected by my Shiny Application (R)
I am facing a problem that you might already have seen : I am trying to create a Shiny app using dygraphs. 我遇到了一个您可能已经看到的问题:我正在尝试使用图表来创建Shiny应用程序。 But, for the first time, when I call the library(dygraphs), in my ui.R file, I get an error : 但是,第一次,当我在ui.R文件中调用库(dygraphs)时,出现错误:
ERROR: there is no package called ‘dygraphs’
I checked whether it was correctly installed on my server : installed.packages()
gives me the line : 我检查了它是否已正确安装在我的服务器上: installed.packages()
给我以下内容:
OS_type MD5sum NeedsCompilation Built
dygraphs NA NA "no" "3.2.1"
require(dygraphs)
gives me : require(dygraphs)
给我:
Loading required package: dygraphs
I have the same version of R on my computer and my server, which is : 我的计算机和服务器上具有相同的R版本,即:
R version 3.2.1 (2015-06-18) -- "World-Famous Astronaut"
And, the weirdest thing : my code works on my computer (with runApp() on Rstudio), but not on my server. 而且,最奇怪的事情是:我的代码可以在我的计算机上运行(在Rstudio上运行runApp()),而不能在我的服务器上运行。
If anyone know how to cope with this problem... Thanks a bunch ! 如果有人知道如何解决这个问题...谢谢大家!
I found the solution, it's possible to see the dependencies of a package with CRAN : https://cran.r-project.org/web/packages/dygraphs/index.html 我找到了解决方案,可以使用CRAN来查看软件包的依赖关系: https ://cran.r-project.org/web/packages/dygraphs/index.html
And eventually, the following line does the trick ! 最终,下面的代码可以解决问题!
install.packages(c("htmlwidgets","xts","zoo","rmarkdown","yaml","dygraphs"),lib="/usr/local/lib/R/site-library",dependencies=TRUE)
Enjoy :) 请享用 :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.