如何在 Debian 中情节地安装 R?

如何在 Debian 中情节地安装 R?

我正在研究矩阵、特征矩阵和网络图的数据可视化,并且我正在尝试通过网络图可视化一维心电图信号。我感觉现在的工具ggnet2可能plotly还不够,但我还没有完成基本测试,plotly因为我无法安装它。我经历了 3 次不成功的安装尝试阴谋地作为 R 提示符下的 root install.packages(plotly),但我不断收到

** building package indices
** testing if installed package can be loaded
* DONE (purrr)
ERROR: dependency ‘openssl’ is not available for package ‘httr’
* removing ‘/usr/local/lib/R/site-library/httr’
ERROR: dependency ‘httr’ is not available for package ‘plotly’
* removing ‘/usr/local/lib/R/site-library/plotly’

The downloaded source packages are in
    ‘/tmp/RtmpoWcHte/downloaded_packages’
Warning messages:
1: In install.packages("plotly") :
  installation of package ‘openssl’ had non-zero exit status
2: In install.packages("plotly") :
  installation of package ‘httr’ had non-zero exit status
3: In install.packages("plotly") :
  installation of package ‘plotly’ had non-zero exit status
> 

作为根迭代 2

与上面相同的问题,但命令略有不同

> install.packages("plotly") 
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
--- Please select a CRAN mirror for use in this session ---
also installing the dependencies ‘openssl’, ‘httr’

trying URL 'https://cran.wu.ac.at/src/contrib/openssl_0.9.5.tar.gz'
Content type 'unknown' length 1236042 bytes (1.2 MB)
==================================================
downloaded 1.2 MB

trying URL 'https://cran.wu.ac.at/src/contrib/httr_1.2.1.tar.gz'
Content type 'unknown' length 133398 bytes (130 KB)
==================================================
downloaded 130 KB

trying URL 'https://cran.wu.ac.at/src/contrib/plotly_4.5.2.tar.gz'
Content type 'unknown' length 731185 bytes (714 KB)
==================================================
downloaded 714 KB

* installing *source* package ‘openssl’ ...
** package ‘openssl’ successfully unpacked and MD5 sums checked
Using PKG_CFLAGS=
Using PKG_LIBS=-lssl -lcrypto
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
 * rpm: openssl-devel (Fedora, CentOS, RHEL)
 * csw: libssl_dev (Solaris)
 * brew: openssl (Mac OSX)
If openssl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a openssl.pc file. If pkg-config
is unavailable you can set INCLUDE_DIR and LIB_DIR manually via:
R CMD INSTALL --configure-vars='INCLUDE_DIR=... LIB_DIR=...'
--------------------------------------------------------------------
ERROR: configuration failed for package ‘openssl’
* removing ‘/usr/local/lib/R/site-library/openssl’
ERROR: dependency ‘openssl’ is not available for package ‘httr’
* removing ‘/usr/local/lib/R/site-library/httr’
ERROR: dependency ‘httr’ is not available for package ‘plotly’
* removing ‘/usr/local/lib/R/site-library/plotly’

The downloaded source packages are in
    ‘/tmp/RtmpU1mQnG/downloaded_packages’
Warning messages:
1: In install.packages("plotly") :
  installation of package ‘openssl’ had non-zero exit status
2: In install.packages("plotly") :
  installation of package ‘httr’ had non-zero exit status
3: In install.packages("plotly") :
  installation of package ‘plotly’ had non-zero exit status

操作系统:Debian 8.5
R:3.3.1

答案1

httr取决于开放式SSL卷曲包裹。该openssl软件包需要作为系统要求libssl-dev

------------------------- ANTICONF ERROR ---------------------------
Configuration failed because openssl was not found. Try installing:
 * deb: libssl-dev (Debian, Ubuntu, etc)
...

curl软件包需要作为系统要求libcurl4-openssl-dev

------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
...

因此,要安装,您需要运行:

sudo apt-get install libssl-dev libcurl4-openssl-dev

之后install.packages("plotly")应该可以工作。

相关内容