Ubuntu의 RStudio에 pdftools를 설치하는 방법은 무엇입니까?

Ubuntu의 RStudio에 pdftools를 설치하는 방법은 무엇입니까?

pdftoolsUbuntu 18.04.3 LTS에서 실행되는 RStudio 1.2.5019에 설치하는 방법을 아는 사람이 있습니까 ? 나는 시도했다:

> install.packages("pdftools")
Installing package into ‘/home/jaakko/R/x86_64-pc-linux-gnu-library/3.4’
(as ‘lib’ is unspecified)
also installing the dependencies ‘curl’, ‘qpdf’

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

trying URL 'https://cloud.r-project.org/src/contrib/qpdf_1.1.tar.gz'
Content type 'application/x-gzip' length 321408 bytes (313 KB)
==================================================
downloaded 313 KB

trying URL 'https://cloud.r-project.org/src/contrib/pdftools_2.3.tar.gz'
Content type 'application/x-gzip' length 934367 bytes (912 KB)
==================================================
downloaded 912 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/jaakko/R/x86_64-pc-linux-gnu-library/3.4/curl’
Warning in install.packages :
  installation of package ‘curl’ had non-zero exit status
ERROR: dependency ‘curl’ is not available for package ‘qpdf’
* removing ‘/home/jaakko/R/x86_64-pc-linux-gnu-library/3.4/qpdf’
Warning in install.packages :
  installation of package ‘qpdf’ had non-zero exit status
ERROR: dependency ‘qpdf’ is not available for package ‘pdftools’
* removing ‘/home/jaakko/R/x86_64-pc-linux-gnu-library/3.4/pdftools’
Warning in install.packages :
  installation of package ‘pdftools’ had non-zero exit status

The downloaded source packages are in
    ‘/tmp/RtmpzEAfLC/downloaded_packages’
> library(pdftools)
Error in library(pdftools) : there is no package called ‘pdftools’

답변1

오류 메시지를 주의 깊게 읽으십시오. Linux에서 R 패키지를 사용하려면 종속성을 먼저 설치해야 하는 경우가 있습니다. 여기 libcurl4-openssl-dev. 이 패키지를 설치하려면 터미널에서 다음 명령을 사용하십시오. 그러면 pdftoolsR에서 설치할 수 있습니다 .

sudo apt install libcurl4-openssl-dev

관련 정보