I have messed up my RStudio settings. I am not sure what I did but I have somehow ruined the PATH to my packages. When I try to simply do library(package), I keep getting an error message. I am running my system on Windows.
library(dplyr)
Error: package or namespace load failed for ‘dplyr’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-3.6.2/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
In addition: Warning message:
package ‘dplyr’ was built under R version 3.6.3
You have messed with the stats package and maybe other base R packages so I would suggest completely removing your package library and reinstalling R (you could take this opportunity to update R as well).
Thank you for your help. I completely uninstalled R and R studio. Reinstalled them (version 3.6 and 4) but I am still getting this same error messages. Could you tell me the code to remove my package library? How do I reset the stats path? Sorry, I am just so frustrated right now that I cannot do the most simple commands.
Uninstalling R doesn't remove the package library, you have to manually go to the installation folder (use the Windows file explorer) and delete it.
Although if you have installed a new R version this shouldn't be an issue anymore since each R version has an independent package library on Windows. Do you get any different error messages with the new R version?
I'm not sure if this is causing your problem but empty spaces in Windows user names usually cause this kind of issues, I would suggest setting your .libPaths to the system level package library only (i.e. "C:\Program Files\R\R-3.6.3\library").
okay how do I find and edit the .Renviron file? I tried using the find command in terminal but it was unable to locate it.
When I tried > Sys.getenv("R_PROFILE_USER")
[
This is what I got.
1] ""
Warning messages:
1: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
2: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
3: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
4: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
5: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
6: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
7: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
8: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
9: In get(Info[i, 1], envir = env) : internal error -3 in R_decompress1
I also tried your advice by using the following:
install.packages("qqman", lib = "C:/Program Files/R/R-3.6.3/library")
And I am still getting the In get(Info...R_decompress1 error message. I assume it is saying that it is still unable to find the environment for the packages?