install and load packages

I got a sudden error in loading packages. I had been able to load same packages before but I am receiving this error one of a sudden. I tried to re-install the packages but still the same errors. Does anybody have any idea?

Error: package or namespace load failed for ‘TraMineR’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):
there is no package called ‘digest’

or like this:

Error: package or namespace load failed for ‘memisc’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]):

I´m trying to reinstalling the R, the Rstudio and install the packages and I always have this kind of messages.

hey @Karina, this can be super frustrating. If you're using RStudio, you can look in the Packages tab and see if digest and memisc are listed. If not, you can try installing them on their own (I've seen this happen where not all dependencies get installed for whatever reason). It seems as though your system thinks these packages are not installed! Does `install.packages("digest") fix the issue?

If what @chris.prener suggests doesn't fix this ...

Are you on Windows? If so, install.packages() can get into a sad state where it gets part way through a (re-)install, but fails, leaving a corrupt version of the package behind. You can't use it, but you can't update it and you seem to be stuck. And you can't install anything that depends on this problem package.

Let's say the problem package is named "foo". In R, note the location of the installed package: system.file(package = "foo") will reveal the folder containing the installed foo package.

Now quit all instances of R and RStudio. Delete the foo package manually, using whatever method you normally use to delete a folder. Then relaunch R, probably within RStudio. Use install.packages() to get a fresh install of foo. If you encountered this problem on the way to installing some other package, it is possible you may need to go through a sequence of such fixes, for various dependencies, to get everything sorted out.

Another explanation of what I am describing:

4 Likes