Error in library(Matrix) : there is no package called ‘Matrix’' in notebook using Mac M1 chip

I get this error trying to run the meta for package, although I checked the path and version and there was no problem

RInterpreterError: Failed to parse and evaluate line '…'.
R error message: 'Error in library(Matrix) : there is no package called ‘Matrix’'

Check:R version 4.2.3 (2023-03-15) -- "Shortstop Beagle"
Copyright (C) 2023 The R Foundation for Statistical Computing
Platform: aarch64-apple-darwin20 (64-bit)

find.package("Matrix")
[1] "/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library/Matrix"
.libPaths()
[1] "/Library/Frameworks/R.framework/Versions/4.2-arm64/Resources/library"
"Matrix" %in% loadedNamespaces()
[1] TRUE
packageVersion("Matrix")
[1] ‘1.6.4’

I want to know what went wrong. Any ideas? Thanks!

It looks like you need to install the {Matrix} package. Try

install.packages("Matrix")

What is the command that outputs this error?

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.