Error While Loading Package "MatrixModels" in Cran R on Debian 12

Dear All,

I have been trying to load the R Package "MatrixModels". My OS is Debian 12. I am getting the following error -

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : namespace ‘Matrix’ 1.5-3 is being loaded, but >= 1.6.0 is required Calls: ... namespaceImportFrom -> asNamespace -> loadNamespace Execution halted ERROR: lazy loading failed for package ‘MatrixModels’ * removing ‘/home/parthasarathighose/R/x86_64-pc-linux-gnu-library/4.2/MatrixModels’ Warning in install.packages : installation of package ‘MatrixModels’ had non-zero exit status

How can I address this error and load the package "MatrixModels"?

Your support will be helpful.

Regards and best,

Partha

‘Matrix’ 1.5-3 is being loaded, but >= 1.6.0 is required

This means that MatrixModels needs a newer version of the Matrix package. If you look at the CRAN page [1], you'll see that it indeed needs 1.6.0.

The problem is that the newest version of Matrix does not support R 4.2.x that you seem to have, so you can't simply install it with install.packages().

I suggest you try pak [2] and do this:

pak::pkg_install(c("Matrix@1.6-5", "MatrixModels"))

[1] CRAN: Package MatrixModels
[2] All about installing pak. — Installing pak • pak