所以我已经安装了 R 3.6.3,并且在安装后尝试加载包时出现错误。我收到以下错误 -
> library(cartogram)
Error: package or namespace load failed for ‘cartogram’ in get(Info[i, 1], envir = env):
lazy-load database 'C:/Users/soumy/Documents/R/win-library/3.6/Rcpp/R/Rcpp.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
> library(tmap)
Error: package or namespace load failed for ‘tmap’ in get(Info[i, 1], envir = env):
lazy-load database 'C:/Users/soumy/Documents/R/win-library/3.6/digest/R/digest.rdb' is corrupt
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
> library(devtools)
Loading required package: usethis
Error: package or namespace load failed for ‘usethis’ in get(Info[i, 1], envir = env):
lazy-load database 'C:/Users/soumy/Documents/R/win-library/3.6/rlang/R/rlang.rdb' is corrupt
Error: package ‘usethis’ could not be loaded
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
> library(pacman)
> pacman :: p_load(ggplot2)
Installing package into ‘C:/Users/soumy/Documents/R/win-library/3.6’
(as ‘lib’ is unspecified)
Warning: unable to access index for repository
http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.6:
cannot open URL 'http://www.stats.ox.ac.uk/pub/RWin/bin/windows/contrib/3.6/PACKAGES'
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.6/ggplot2_3.3.2.zip'
Content type 'application/zip' length 4068914 bytes (3.9 MB)
downloaded 3.9 MB
package ‘ggplot2’ successfully unpacked and MD5 sums checked
The downloaded binary packages are in
C:\Users\soumy\AppData\Local\Temp\RtmpcTrH1e\downloaded_packages
ggplot2 installed
Warning messages:
1: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
2: In pacman::p_load(ggplot2) : Failed to install/load:
ggplot2
我尝试将 R、Rtools 和 Rstudio 添加到系统变量 Path,尝试重新启动 R,多次尝试重新安装 R,但没有成功。
我也尝试在 Anaconda Jupyter 笔记本中安装 R,尽管已安装,但 R 内核未加载并显示这些错误 -
Error in get(Info[i, 1], envir = env) :
lazy-load database 'C:/Users/soumy/Documents/R/win-library/3.6/digest/R/digest.rdb' is corrupt
Calls: :: ... namespaceImport -> loadNamespace -> registerS3methods -> get
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
Execution halted
[I 03:27:26.891 LabApp] Kernel started: e5475cc5-3dcc-4ab4-a0fb-a4c106b53d4f
[I 03:27:27.380 LabApp] KernelRestarter: restarting kernel (1/5), new random ports
Error in get(Info[i, 1], envir = env) :
lazy-load database 'C:/Users/soumy/Documents/R/win-library/3.6/digest/R/digest.rdb' is corrupt
Calls: :: ... namespaceImport -> loadNamespace -> registerS3methods -> get
In addition: Warning message:
In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
Execution halted
该错误的相似性质表明 R 控制台可能存在问题?
请帮忙。
最佳答案
我遇到了类似的问题,但是使用 Clusterprofiler 和其他软件包:
“错误:无法在 get(Info[i, 1], envir = env) 中加载 'clusterProfiler' 的包或命名空间:延迟加载数据库 'C:/Users/mailen/Documents/R/win-library/4.1/scales/R/scales.rdb' 已损坏另外:警告消息:在 get(Info[i, 1], envir = env) 中:R_decompress1 中的内部错误 -3"
解决方案是卸载R,然后安装最新版本,卸载R studio并重新安装后。我发现由于某种奇怪的原因 Rstudio 和 R 没有使用相同的版本
关于r - 安装后无法加载R包,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63855025/