gpt4 book ai didi

r - 无法在 R 中安装 Plotly

转载 作者:行者123 更新时间:2023-12-04 16:10:07 28 4
gpt4 key购买 nike

我正在尝试在 R 中安装 plotly 库。我尝试了以下命令:

install.packages("plotly")
library(plotly)

但是我得到了一个错误。

There is a binary version available but the source version is later:
binary source needs_compilation
plotly 4.5.6 4.6.0 FALSE

installing the source package ‘plotly’

trying URL 'https://cran.rstudio.com/src/contrib/plotly_4.6.0.tar.gz'
Content type 'application/x-gzip' length 980458 bytes (957 KB)
==================================================
downloaded 957 KB

* installing *source* package ‘plotly’ ...
** package ‘plotly’ successfully unpacked and MD5 sums checked
** R
** data
*** moving datasets to lazyload DB
** demo
** inst
** preparing package for lazy loading
Warning: package ‘ggplot2’ was built under R version 3.3.2
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘assertthat’
ERROR: lazy loading failed for package ‘plotly’
* removing ‘/Library/Frameworks/R.framework/Versions/3.3/Resources/library/plotly’
Warning in install.packages :
installation of package ‘plotly’ had non-zero exit status

The downloaded source packages are in
‘/private/var/folders/7c/6q_1znps54zc62j_9pr_tx9c0000gn/T/RtmpyyWVTb/downloaded_packages’

有人可以帮助解决安装 R 的错误吗?

最佳答案

您需要安装所有在错误消息中指定的包。还有一些其他的依赖项需要安装。 Derby 安:

sudo apt-get install libssl-dev
sudo apt-get install libcurl4-openssl-dev
sudo apt-get install libssh2-1-dev
sudo apt-get install libpq-dev
sudo apt-get install zlib1g-dev

中心:

sudo yum -y install openssl-devel
sudo yum -y install libcurl libcurl-devel

您不需要所有这些,但更安全。我也喜欢安装 devtools:install.packages("devtools")

关于r - 无法在 R 中安装 Plotly,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44013764/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com