Issue while loading Hmisc package

I installed R studio version 4.0.2. Since then I am unable to load various packages like Hmisc. Error that I get is "Error: package or namespace load failed for ‘Hmisc’:package ‘jpeg’ was installed before R 4.0.0: please re-install it" . I tried installing the package and also added dependencies=True argument but still getting the same error. as soon as I try to add Hmisc again same error pops with a different package name that requires installation.

After updating R you have to update your packages with checkBuilt = TRUE

update.packages(checkBuilt=TRUE)

Thanks for your response;although am still facing the same issue.Error I get at the end is Try removing ‘C:\Program Files\R\R-4.0.2\library/00LOCK’
In addition: Warning message:
In file.copy(savedcopy, lib, recursive = TRUE) :
problem copying C:\Program Files\R\R-4.0.2\library\00LOCK\backports\libs\x64\backports.dll to C:\Program Files\R\R-4.0.2\library\backports\libs\x64\backports.dll: Permission denied
and then again as soon as I try to bring Hmisc package over the session via library() command. I get the following issue

library(Hmisc)
Loading required package: lattice
Loading required package: survival
Loading required package: Formula
Loading required package: ggplot2
Error: package or namespace load failed for ‘Hmisc’:
package ‘rstudioapi’ was installed before R 4.0.0: please re-install it

Restart your RStudio session and try to update the packages before doing anything else (it seems some packages are already loaded which prevents them from update). If that doesn't work, try manually deleting the offending file using the file explorer

Thanks,it helped although after restarting R session used unlink("C:/Program Files/R/R-4.0.2/library/00LOCK", recursive = TRUE) command and then updated the command using update.packages(checkBuilt = T,ask=FALSE). so all set now.
Regards

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.