'R hangs every time I try to run library(mediation)

Everything else is running fine- laptop is not overburdened otherwise. I think it might be a package or R problem.

Other packages I activated are: library(Hmisc) library(tidyverse) library(psych) library(car) library(MASS) library(ppcor) library(mediation)



Solution 1:[1]

I don't really know the package in object. But I think there are a couple of things you could do:

  1. updating dependent packages for mediation package
  2. updating all packages
  3. Check and update the R utils package
  4. updating the R version

Recently I was unable to load some different packages (similarly to what happened to you) I had to uninstall and reinstall the latest R version. This works most of the times.

Hence consider UNINSTALL and REINSTALL if the above don't work.

Remember to restart R everytime you update.

I know this is probably the oldest trick in the book and not very specific to your case but this turns out to be the fastest solution rather than understanding package conflicts.

Let me know if this works

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Alfredo Marchetti