牛丼時給調査会

牛丼チェーン店週次アルバイト時給調査:牛丼短観. [牛丼短観は毎週土曜更新です]

install.packages("tidyverse")時のエラー(gdalが存在しない等)への対処

Rパッケージインストール時に詰まるであろう箇所のメモ。

環境(バージョン)

$ cat /etc/debian_version 
11.6
$ R --version
R version 4.0.4 (2021-02-15) -- "Lost Library Book"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
...
$

opensslv.hが存在しないよエラー

fatal error: openssl/opensslv.h: No such file or directory
対処

shell上(R上ではない)で

$ sudo apt install libssl-dev libudunits2-dev

ref:
askubuntu.com

gdalが存在しないよ このバージョンのRでは使えないよエラー

...
configure: error: gdal-config not found or not executable
...

install.packages("gdal-config") をR上で試行してもエラーを吐く。

> install.packages("gdal")
Installing package into ‘/usr/local/lib/R/site-library’
(as ‘lib’ is unspecified)
Warning message:
package ‘gdal’ is not available for this version of R
...
対処

shell上(R上ではない)で

$ sudo apt install libgdal-dev

ref:
stackoverflow.com