Win11系统
安装rms的时候报错:
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace 'Matrix' 1.5-4.1 is already loaded, but >= 1.6.0 is required
## 安装rms的时候报错,显示Matrix的版本太低,卸载旧版本,安装新版本的Matrix显示如下:
cannot rename file 'D:/R/R-4.3.1/library/00LOCK-Matrix/00new/Matrix' to 'D:/R/R-4.3.1/library/Matrix', reason '拒绝访问。'
解决方案
package_url="https://cran.r-project.org/src/contrib/Archive/Matrix/Matrix_1.6-0.tar.gz"
install.packages(package_url, repos = NULL, type = 'source')
library(Matrix)
install.packages("rms")