即使我已经安装了图书馆tidyverse,也无法加载

时间:2019-08-21 15:06:08

标签: r dataframe tidyverse

我第一次跑步:

install.packages(“ tidyverse”)

运行完毕后,最后会说:

Warning in install.packages :
  installation of package ‘tidyverse’ had non-zero exit status
The downloaded source packages are in
    ‘/tmp/RtmpWG5QjC/downloaded_packages’

但是当我尝试运行时:

library(tidyverse)

我收到此回复:

Error in library(tidyverse) : there is no package called ‘tidyverse’

然后我在R中的ubuntu控制台上执行此过程,但我再次得到相同的结果

下载时的全部输出:

Installing package into ‘/home/anastasis/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘httr’, ‘rvest’, ‘xml2’

trying URL 'https://cloud.r-project.org/src/contrib/curl_4.0.tar.gz'
Content type 'application/x-gzip' length 379180 bytes (370 KB)
==================================================
downloaded 370 KB

trying URL 'https://cloud.r- 
project.org/src/contrib/httr_1.4.1.tar.gz'
Content type 'application/x-gzip' length 158465 bytes (154 KB)
==================================================
downloaded 154 KB

trying URL 'https://cloud.r- 
project.org/src/contrib/rvest_0.3.4.tar.gz'
Content type 'application/x-gzip' length 1631028 bytes (1.6 MB)
==================================================
downloaded 1.6 MB

trying URL 'https://cloud.r- 
project.org/src/contrib/xml2_1.2.2.tar.gz'
Content type 'application/x-gzip' length 261081 bytes (254 KB)
==================================================
downloaded 254 KB

trying URL 'https://cloud.r- 
project.org/src/contrib/tidyverse_1.2.1.tar.gz'
Content type 'application/x-gzip' length 61647 bytes (60 KB)
==================================================
downloaded 60 KB

* installing *source* package ‘curl’ ...
** package ‘curl’ successfully unpacked and MD5 sums checked
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Package libcurl was not found in the pkg-config search path.
Perhaps you should add the directory containing `libcurl.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libcurl' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lcurl
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libcurl was not found. Try installing:
 * deb: libcurl4-openssl-dev (Debian, Ubuntu, etc)
 * rpm: libcurl-devel (Fedora, CentOS, RHEL)
 * csw: libcurl_dev (Solaris)
If libcurl is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libcurl.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 ‘curl’
* removing ‘/home/anastasis/R/x86_64-pc-linux-gnu-library/3.4/curl’
Warning in install.packages :
  installation of package ‘curl’ had non-zero exit status
* installing *source* package ‘xml2’ ...
** package ‘xml2’ successfully unpacked and MD5 sums checked
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Package libxml-2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libxml-2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package 'libxml-2.0' found
Using PKG_CFLAGS=
Using PKG_LIBS=-lxml2
------------------------- ANTICONF ERROR ---------------------------
Configuration failed because libxml-2.0 was not found. Try installing:
 * deb: libxml2-dev (Debian, Ubuntu, etc)
 * rpm: libxml2-devel (Fedora, CentOS, RHEL)
 * csw: libxml2_dev (Solaris)
If libxml-2.0 is already installed, check that 'pkg-config' is in your
PATH and PKG_CONFIG_PATH contains a libxml-2.0.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 ‘xml2’
* removing ‘/home/anastasis/R/x86_64-pc-linux-gnu-library/3.4/xml2’
Warning in install.packages :
  installation of package ‘xml2’ had non-zero exit status
ERROR: dependency ‘curl’ is not available for package ‘httr’
* removing ‘/home/anastasis/R/x86_64-pc-linux-gnu-library/3.4/httr’
Warning in install.packages :
  installation of package ‘httr’ had non-zero exit status
ERROR: dependencies ‘xml2’, ‘httr’ are not available for package ‘rvest’
* removing ‘/home/anastasis/R/x86_64-pc-linux-gnu-library/3.4/rvest’
Warning in install.packages :
  installation of package ‘rvest’ had non-zero exit status
ERROR: dependencies ‘httr’, ‘rvest’, ‘xml2’ are not available for 
package ‘tidyverse’
* removing ‘/home/anastasis/R/x86_64-pc-linux-gnu- 
library/3.4/tidyverse’
Warning in install.packages :
  installation of package ‘tidyverse’ had non-zero exit status

The downloaded source packages are in
        ‘/tmp/RtmpWG5QjC/downloaded_packages’

我已经安装了xml2依赖项,但是当我使用tidyverse重做该过程时,会得到相同的结果

1 个答案:

答案 0 :(得分:0)

<块引用>

library(tidyverse) 是语法错误。

试试这样的双引号

<块引用>

图书馆(“tidyverse”)