R packages can not be found

I am a data analyst with very limited knowledge of software architecture (I code and analyze the statistics). My IT unit knows nothing of R. It worked for about two years than R and R studio was reinstalled on a new machine. Now nothing works. When I open it I get
#During startup - Warning message:
package ‘stats’ in options("defaultPackages") was not found
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Program Files/R/R-4.3.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.

When I try to use any package I get similar errors. IT removed R, Rtools, and Rstudio today and reinstalled it and I got the error above - before I did not - I just could not use any package. I got
image Any help would be deeply appreciated both my IT unit and I are lost.

  1. Does the stats.dll file exist at the indicated path?

  2. Are R and RStudio installed on this computer for all users or just for you?

  3. Is the error message shown from starting RStudio or from starting R?

  4. If it is from starting RStudio, what happens if you run R from a command prompt -- does it start or does it throw an error?

1 Like

So, depending on the operating system. Installing the packages once should resolve the issue per project (Wiley, Wiley, 2020). Although install(“packagename”) in the console and library(packagename) in the script are effective when opening the R studio, e.g., a recomplie the packages can be reloaded through the above or running the code with the library calls or checkboxed packages in the lower right quadrant of the integrated development environment (Wiley, Wiley, 2020). A stable build?
Install the packages, such as quartz, fortran, and homebrew session establishment for running the commands off the libraries (Wiley, Wiley, 2020). This recursive process, until stable, should be efficient.

References
Wiley, M., & Wiley, J. F. (2020). Beginning R 4: From beginner to Pro. Apress.

Hi @noetsi ,

That error apparently indicates that you have problems with your user's permissions to access the R base package files.

You could suggest to your IT team to give you permissions that you can access without problems to the local disk where they install the programs with write and edit permissions. I suggest that they give you all the permissions, sometimes the IT team is very complicated and they put a lot of work for your work.

You can access to this file, C:/Program Files/R/R/R-4.3.3/library/stats/libs/x64/

Can you run R as admin? Try to install all the dependencies and run them as admin.

Thank you. Its strange this happened, I had it before. I will send this to my IT unit.

~WRD0000.jpg

  1. Does the stats.dll file exist at the indicated path? Yes it does I checked yesterday
  2. Are R and RStudio installed on this computer for all users or just for you? I am the only one with access to this computer although IT installed the packages so I am not sure. I will ask.
  3. Is the error message shown from starting RStudio or from starting R? I only use R through RStudio so I guess the answer would be starting RStudio
  4. If it is from starting RStudio, what happens if you run R from a command prompt -- does it start or does it throw an error? I don't know how to run R that way, I never have. I only have access to R through R studio.

Thanks.

Try running R from a command prompt. (If it's not on your system path, you may need to find the path to it first.) If R runs, that narrows the problem down to RStudio. If R produces the same error, that says the problem is with the R installation.

If the problem is with RStudio, you might take a look at the instructions here for resetting RStudio's state. Uninstalling/reinstalling typically does not reset the state. The error message does not look like the result of a buggered desktop state, but you never know until you try.

Thanks. I am not sure how to do that (but I will try to find out).

How do you open r without going to Rstudio (I don’t even know how to go to R outside Rstudio I never have coded R that way).

Is it possible for me to run R as an administrator? Can I do this?

You could suggest to your IT team to give you permissions that you can access without problems to the local disk where they install the programs with write and edit permissions. I suggest that they give you all the permissions, sometimes the IT team is very complicated and they put a lot of work for your work.

You can access to this file, C:/Program Files/R/R/R-4.3.3/library/stats/libs/x64/

Note this is a new issue it did not occur before we uninstalled and reinstalled R/Rstudio. Even if it works, it might not fix the original problem.

If you copy and paste from another post, it becomes difficult to tell which words are yours and which belong to someone else. Here's a mechanism for quoting from a post by selecting the text you want to quote:

which, if you select "Quote", results in this:

And to answer your question, only your IT team can answer it, and as to:

one possibility is that the IT teams may have inadvertently changed the permission structure when it reinstalled R and RStudio.

Thanks. I was answering these through email where the quote functionality does not show up. I just realized I needed to go to the site to address the points.

Open a terminal (command line) window, and on the command line try running "R.exe". If that doesn't work, find where the R.exe file is hiding (presumably somewhere under C:/Program Files/R/R/R-4.3.3/) and type in the full path to it. If R starts, you will have an interactive window equivalent to what you have in the Console tab in RStudio.

Finally realized I needed to come here rather than reply though emails. I tried running as an administrator. Nothing changed. I know this is a really dumb question, but how do I do this.

Open a terminal (command line) window,

I don't even know how to open a terminal window. Historically Rstudio worked fine so I never went beyond that.

If @noetsi has little experience with terminal, would the R GUI give equivalent information? (Mac user here.) If so, @noetsi should be able to use File Explorer to search for "R GUI" and double-click when found, right?

I'm a Linux user, and I don't think the R GUI exists for us. In any event, the goal is to get RStudio (which I understand is a much better user experience) to work. The command line experiment is just to narrow down whether the culprit is R or RStudio.

1 Like

In that case, @noetsi : Could you search for "Rgui" in a File Explorer window, double-click on the file "Rgui.exe" if you find it, and report the result here?

I wanted to thank all the people who provided assistance to this. Because of the inexperience we have here and the need to do things quickly (I have to use ARIMA to forecast this week) we went with a very simple solution. We just loaded R, Rstudio, and R tools on another computer than mine. And it worked fine. Which is wacky to me, but since it works I went with it. Thanks.

1 Like

This topic was automatically closed 90 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.