I am trying to run a multi-level model using the lmer function from the lme4 package but when I try and run the model, I get the following error:
<code>Error in initializePtr() :
function 'cholmod_factor_ldetA' not provided by package 'Matrix'
</code>
<code>Error in initializePtr() :
function 'cholmod_factor_ldetA' not provided by package 'Matrix'
</code>
Error in initializePtr() :
function 'cholmod_factor_ldetA' not provided by package 'Matrix'
This is what my code currently looks like:
<code>install.packages("lme4")
library(lme4)
tools::package_dependencies("Matrix", which = "LinkingTo", reverse = TRUE)[[1L]]
install.packages("lme4", type = "source")
library (lme4)
library (Matrix)
model <- with(df,
lmer(weight ~ 1
+ age*social_contact_family
+ baseline_weight + height
+ sex + ethnicity_cat
+ (1 + age|id),
REML = TRUE))
</code>
<code>install.packages("lme4")
library(lme4)
tools::package_dependencies("Matrix", which = "LinkingTo", reverse = TRUE)[[1L]]
install.packages("lme4", type = "source")
library (lme4)
library (Matrix)
model <- with(df,
lmer(weight ~ 1
+ age*social_contact_family
+ baseline_weight + height
+ sex + ethnicity_cat
+ (1 + age|id),
REML = TRUE))
</code>
install.packages("lme4")
library(lme4)
tools::package_dependencies("Matrix", which = "LinkingTo", reverse = TRUE)[[1L]]
install.packages("lme4", type = "source")
library (lme4)
library (Matrix)
model <- with(df,
lmer(weight ~ 1
+ age*social_contact_family
+ baseline_weight + height
+ sex + ethnicity_cat
+ (1 + age|id),
REML = TRUE))
I have tried restarting the session, uninstalling and re-installing packages, and changing the process of installing “lme4”. I have tried the code based on responses in these forums, which still doesn’t work:
- https://forum.posit.co/t/error-in-loading-lme4-and-matrix-packages-to-create-a-generalized-linear-mixed-effects-model/182172 and
- “Error in initializePtr() : function ‘cholmod_factor_ldetA’ not provided by package ‘Matrix'” when using lmer function in R
I have an up-to-date version of the package and of R.
Please can someone suggest a solution?
Thank you!