how to fix the namespace error when installing rms package?

210 views Asked by At

I installed the package with the code: install.packages("rms",dependencies = TRUE), when dependencies=false I get the same problem

when I try to load the package I get the following message:

"Error: package or namespace load failed for ‘rms’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘MatrixModels’"

Generallty I want to use the ols function:

regress_a <- ols(voted~hawthorne+civicduty+neighbors+self, data=social,method="qr",x=T);
cluster_std_regress_a<-robcov(regress_a,social$hh_id,method=c('efron'));
print(cluster_std_regress_a)

and can't get it to work

is there something else that I can use? or a way to get rms to work?

1

There are 1 answers

0
Joan On

I know Roman answered your question already, and I think that should work. But here just another tip, you could try using a package manager such as pak or pacman. I would recommend pak over pacman even though they both work great. As the former gives you an overview of dependencies and which packages are going to be installed a priori. For more info: https://github.com/r-lib/pak