【R】tidyverse软件包,haven.so和readxl.so报错

安装错误

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

无法载入共享目标对象‘/home/R/x86_64-redhat-linux-gnu-library/3.6/00LOCK-readxl/00new/readxl/libs/readxl.so’::
  /home/R/x86_64-redhat-linux-gnu-library/3.6/00LOCK-readxl/00new/readxl/libs/readxl.so: undefined symbol: libiconv


解决办法

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

posted on 2019-12-20 17:54  萧飞IDO  阅读(1076)  评论(0编辑  收藏  举报

导航