library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in dyn.load(file, DLLpath = DLLpath, ...):
unable to load shared object '/root/Miniconda3/lib/R/library/haven/libs/haven.so':
/root/Miniconda3/lib/R/library/haven/libs/haven.so: undefined symbol: libiconv

解决方法:

withr::with_makevars(c(PKG_LIBS = "-liconv"), install.packages("haven"), assignment = "+=")
install.packages("tidyverse")

搞定!

> install.packages("tidyverse")
Installing package into ‘/root/Miniconda3/lib/R/library’
(as ‘lib’ is unspecified)
trying URL 'https://mirrors.tongji.edu.cn/CRAN/src/contrib/tidyverse_1.2.1.tar.gz'
Content type 'application/octet-stream' length 61647 bytes (60 KB)
==================================================
downloaded 60 KB

* installing *source* package ‘tidyverse’ ...
** package ‘tidyverse’ successfully unpacked and MD5 sums checked
** R
** inst
** byte-compile and prepare package for lazy loading
** help
*** installing help indices
*** copying figures
** building package indices
** installing vignettes
** testing if installed package can be loaded
* DONE (tidyverse)

The downloaded source packages are in
‘/tmp/Rtmp4HcS1y/downloaded_packages’
Updating HTML index of packages in '.Library'
Making 'packages.html' ... done
> library(tidyverse)
── Attaching packages ─────────────────────────────────────── tidyverse 1.2.1 ──
✔ ggplot2 3.0.0 ✔ purrr 0.3.2
✔ tibble 2.1.1 ✔ dplyr 0.8.0.1
✔ tidyr 0.8.1 ✔ stringr 1.3.1
✔ readr 1.3.1 ✔ forcats 0.4.0
── Conflicts ────────────────────────────────────────── tidyverse_conflicts() ──
✖ dplyr::filter() masks stats::filter()
✖ dplyr::lag() masks stats::lag()

tidyverse安装报错/haven/libs/haven.so: undefined symbol: libiconv_html