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

おすすめ記事