I have installed some packages on R Studio on my laptop, and I am having some issues opening them. When I try
require(ggplot)
I get this error:
Error: package or namespace load failed for ‘ggplot2’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Users/marky/OneDrive/Documents/R/win-library/3.4/Rcpp/libs/x64/Rcpp.dll':
LoadLibrary failure: %1 is not a valid Win32 application.
Any clue to what is going on? It appears that Rcpp has something to do with converting C++ to R. When I go to the directory, I see it (although the size is 0KB). I also get this error on the UI
Related
I cannot get spatstat to install properly in R.
I have updated R to the newest version(4.1.2) and installed RTools40 following these instructions (https://cran.r-project.org/bin/windows/Rtools/rtools40.html).
I have restarted R several times and tried to install spatstat as well as spatstat data, but whenever I try and call the library, I get the following error
library(spatstat)
Loading required package: spatstat.data
Error: package or namespace load failed for ‘spatstat.data’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.1.2/library/stats/libs/i386/stats.dll':
LoadLibrary failure: The specified module could not be found.
Error: package ‘spatstat.data’ could not be loaded
library(spatstat.data)
Error: package or namespace load failed for ‘spatstat.data’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.1.2/library/stats/libs/i386/stats.dll':
LoadLibrary failure: The specified module could not be found.```
Small update:
I've tried this for other tools as well and I'm getting the same error.
Example:
library(GISTools)
Loading required package: maptools
Loading required package: sp
Error: package or namespace load failed for ‘sp’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.1.2/library/stats/libs/i386/stats.dll':
LoadLibrary failure: The specified module could not be found.
Error: package ‘sp’ could not be loaded
library(sp)
Error: package or namespace load failed for ‘sp’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.1.2/library/stats/libs/i386/stats.dll':
LoadLibrary failure: The specified module could not be found.
Another update: I now get this error when I start R.
Looks like something is weird with your R installation. Is it an option to remove R, restart and install it again? Do recommend packages even work? E.g. library(MASS)?
I needed to delete the .Renviron file that was created and then everything worked
I'm really having problems with RStudio.
It had been working fine a few days ago. Then it said I needed the newest version of RTools. I tried to install it but don't think it was successful. However now I can't load anything in R.
I am greeted with the following message when launching RStudio:
Error: package or namespace load failed for ‘stats’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-3.6.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
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-3.6.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
I have looked up solutions to this problem and people say to delete /Renviron but I don't know will that mess things up even more.
Here are a few results of things I type into R:
> Sys.getenv("PATH")
[1] "C:\rtools40"
> Sys.which("stats.dll")
stats.dll
""
> Sys.which("make")
make
""
I really don't understand what has gone wrong. Can anyone help?
You accidentally overwrote the PATH envvar. Your line in .Renviron must be: PATH="C:/rtools40/usr/bin;${PATH}" (mind the " and the {}), otherwise you'll lose the R installation path and R will not be able to load the shared library.
I've just installed R x64 4.0.0 to my computer and have been trying to install RStudio.
When launching R by itself, I'm able to install packages and execute code no problem. However, when I open RStudio I get a system error saying that Rlapack.dll is missing from my computer and am prompted to reinstall the program which I have done several times to no avail. I have also tried reinstalling RStudio several times.
The following errors appear on the RStudio console after "oking" the system error popup:
Error: package or namespace load failed for ‘stats’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-4.0.0/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
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.0.0/library/stats/libs/x64/stats.dll':
LoadLibrary failure: The specified module could not be found.
I have also searched for the supposed missing dll in the R installation and found it in this location "C:\Program Files\R\R-4.0.0\bin\x64"
I am unable to run scripts through the RStudio IDE - does anyone know how to fix this dll issue and get RStudio working?
After scouring the internet and spending the best part of a day trying to get to the bottom of this, I have found something that seems to work..
Copy Rlapack.dll from
C:\Program Files\R\R-4.0.0\bin\x64
and paste it into the following locations:
C:\Program Files\R\R-4.0.0\library\stats\libs\x64
C:\Program Files\R\R-4.0.0\library\Matrix\libs\x64
I've first updated R (from 3.6.3 to 4.0) and afterwards RStudio (from 1.2.5033 to the most recent 1.2.5042) on Windows 10. Because I kept receiving the error messages below, I downgraded to R 3.6.3 and Rstudio 1.1.463. However, the errors persist. When opening RStudio I receive the following:
Error: package or namespace load failed for ‘stats’ in inDL(x, as.logical(local), as.logical(now), ...):
unable to load shared object 'C:/Program Files/R/R-3.6.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure:....
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-3.6.3/library/stats/libs/x64/stats.dll':
LoadLibrary failure:...
stats.dll is in the above mentioned location.
Interestingly, I can use functions from the stats package in R.exe suggesting that RStudio causes the errors.
Similarly, I can't print a sessionInfo():
Error in La_library() : LAPACK routines cannot be loaded
In addition: Warning message:
In La_library() :
unable to load shared object 'C:/PROGRA~1/R/R-36~1.3/modules/x64/lapack.dll':
LoadLibrary failure:...
...even though lapack.dll is in the correct place.
It looks as there is confusion between folders of the old (3.6.3) and the new (4.0) version of R, see also this answer.
Suggestion: uninstall both versions of R and install R 4.0 from scratch into a new folder.
Using R 3.1.1 64-bit in Windows 7, I am unable to load RCurl or any package which depends on RCurl. I have verified the existence of the .dll and other files in the expected location (i.e. the one printed in the error messages).
I opened an issue on Hadley's Github several months ago, but by the time someone responded I had started using another copy of R and the only suggestion was re-installation, which I've done several times.
The errors that I receive are like this:
require(devtools)
Loading required package: devtools
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/jmiller/Documents/R/win-library/3.1/RCurl/libs/i386/RCurl.dll':
LoadLibrary failure: The specified procedure could not be found.
and
require(devtools)
Loading required package: devtools
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/jmiller/Documents/R/win-library/3.1/RCurl/libs/i386/RCurl.dll':
LoadLibrary failure: The specified procedure could not be found.
Sometimes the errors appear even when only using primitive functions that are completely unrelated to RCurl, such as:
> require(devtools)
Loading required package: devtools
Error in inDL(x, as.logical(local), as.logical(now), ...) :
unable to load shared object 'C:/Users/jmiller/Documents/R/win-library/3.1/RCurl/libs/i386/RCurl.dll':
LoadLibrary failure: The specified procedure could not be found.
I almost wonder if the problem is somehow with inDL instead of RCurl but inDL?...