System Error after installing R package - r

I am running R 3.2.2 on Windows 8. After installing R packages, rattle and rpart.plot in RStudio an error message propped up in a separate panel.
Rterm.exe - System Error.
The program can't start because libatk-1.0-0.dll is missing from your computer.
Try reinstalling the program to fix this problem.
Does anybody have any clue as to what this means and how to fix this?

Thank you all for your inputs. I managed to figure it out.
The problem arose as a result of missing GTK+ file. I'm not exactly sure what GTK+ really is, but I know that GTK+ is a preliminary file needed to install the Rattle Package. Here's the step I took to download the GTK+ file.
First, remove all the tabs opened in RStudio.
Use install.packages to download Rattle package. A window should pop up asking to see if you want to download GTK+. Click Yes.
Restart RStudio.

I tried closing all the tabs and installing rattle but no pop up appear for me. I then tried installing the package "RGTK2" (fyi, my R studio is version 3.2.0) and after completing this installation, the error message can be closed off.
I restarted Rstudio and the rterm.exe error didn't appear anymore.

I had this issue.
1) Close all open source code tabs
2) install.packages("RGtk2")
I didn't even need to restart R-Studio

I just wanted to add a variation of this error. The error only appeared when using RStudio and not in the RGui. I followed Daniel Lee's answer but with no luck at first, but it pointed me in the right direction. I closed RStudio and opened The R console (RGui), and decided to uninstall the rattle package first, and then reinstalled it again. I never got the pop-up asking about downloading the GTK+. It was only when I specifically tried to run rattle: rattle() that rattle complained that the it could not find the GTK+ and prompted me to download and install it. As it turned out I had already downloaded this via another source, so rattle could not install it as it was already installed and was presented with the following warning:
Warning messages:
1: Failed to load RGtk2 dynamic library, attempting to install it.
2: In dir.create(config_path, recursive = TRUE) :
'C:\Users\[me]\Documents\R\win-library\3.3\RGtk2\gtk\x64\etc\gtk-2.0' already exists
I then attempted to start rattle, which was successful. I then started up RStudio and again fire up rattle again with success, and the error libatk-1.0-0.dll is missing has now disappeared.
Current setup: R version 3.3.0, RStudio version 0.99.896

Try uninstalling the rattle package, then it will prompt to install GTK+. Install that and then cancel the uninstall of the rattle package. Quit R studio and restart it. The libtak error will disappear.

I would only get this error when running RStudio. I did close all my RStudio tabs and cleared the workspace as suggested by others. Installing rattle from RStudio would still produce the error. For me, it looks like RStudio could not install RGtk2 due to some permissions issue (i.e. Access Denied with removing the old RGtk2).
I had to manually delete rattle and RGtk2 folders from my R library folder (for me it was in my users folder My Documents\R\win-library\3.3). Then from Rgui (NOT RStudio), I did install.packages("rattle"). This also installed RGtk2 without any permissions issues. The error is now gone.

Incase if it has occured from installing the rattle package in R,Just uninstall the package using remove.packages() and restart the R session. The error dissapears :)

To answer the question:
Does anybody have any clue as to what this means ?
It happens in RStudio and is related to rattle which uses RGtk2. -
This problem is because you had order version of RGtk2 installed (likely 2.20.30), which was the highest possible version for earlier version of RStudio (likely 1.0.44 or earlier) and which is required for rattle. Now when you installed new version of RStudio (1.0.143), it is not compatible with older RGtk2 version. Once you install RGtk2 again (just from Tools menu or run install.packages("RGtk2") in RStudio) , it will overwrite the old version of RGtk2 with newest (2.20.33 version), which is now compatible with 1.0.143 version of RStudio, and this fixes the problem.

Related

Error: package or namespace load failed for 'ggplot2': package 'ggplot2' was installed before R 4.0.0: please re-install it Execution halted

I'm really stuck and need some help.
After installing R 4.0.2, I'm getting this error message on R visualizations in Power BI Desktop which were previously working
"Error: package or namespace load failed for 'ggplot2':
package 'ggplot2' was installed before R 4.0.0: please re-install it.
Execution halted"
I already tried to:
reinstall R 4.0.2
reinstall RStudio
reinstall ggplot2
reinstall all packages
reinstall Power BI Desktop. My version is August-2020
Still it does not work.
Considerations:
My visualizations were working well before I installed R 4.0.2
My visualizations are working well on other PCs
When I run the code on RStudio I don't get any error
Any thoughts?
You probably need to go here: https://powerbi.microsoft.com/en-us/support/, but some guesses:
When you did the reinstall, you didn't clean up the old one, so you now have a mix of old and new versions of things. If you can run R code, run
system.file(package="ggplot2")
That's where it is finding the bad version of ggplot2. Get rid of it, and reinstall. If that's not enough, run
.libPaths()
in the broken copy of R. Completely eradicate every directory mentioned there, and reinstall R and all of your contributed packages. (I don't use Power BI, so this might also require you to wipe out some part of it: do so, and reinstall it.)
After all of this, run
packageDescription("ggplot2")
In the last line (or close to it) of what gets printed, you should see something like this:
Built: R 4.0.2; ; 2020-07-16 22:49:23 UTC; unix
If you see that it was built before 4.0.2, then either you missed deleting something, or you (or Microsoft) reinstalled some old version. Then it's probably time to contact that URL above.

R/Rstudio stop working after loading Rcmdr package

I got this problem after installing the new version of Rstudio/R , I had R version 3.6 and Rstudio 1.2.xx and after update I got this .T hen I tried doing a clean install , and reinstalling the packages I had , the installation went fine but I got this problem. Anyone has an idea? I tried looking on the net but didn't find a solution.
Note that It's the same either for Rstudio or Rgui , I end up with either this message error or gui closes (Rgui case).
Are you on Windows? If so this is a known issue and why R 4.0.1 will be replaced by R 4.0.2 on Monday (i.e. in three days).
There should also be a R 4.0.1.patched binary at CRAN which would help you now too. You can try this page with its '4.0.2 release candidate'.

Unable to open the R/Cape Package

Currently running R version 3.6.2 and RStudio version 1.2.5033 (both the latest versions as of today).
I have installed the R/Cape package from https://CRAN.R-project.org/package=cape, although when I try to load the package into R studio using:
library(cape)
I get the following from the RStudio console. RStudio then stops responding. I have tried this in just R as well and R also stops responding.
Can anybody please tell me if they've had any similar experiences and how they resolved them? Or if you've managed to install the 'cape' package how you did so?
The 'cape' library depends on other packages like 'htmltools' and many others. This is not an error message, just a warning. It means that some of the functions from 'tools:rstudio' will be replaced by other functions with the same name. See this answer which already addresses this.
As for the non-responsive behaviour, it is probably unrelated to the warnings discussed above. Try reinstalling R and updating all your packages. In Rstudio, you can update all your packages by clicking Tools > Update Packages > Select All > Install Updates.

Checking if package installed without errors in R

Background to the problem
I have tried to install the robustlmm package in R, but while trying to install it the R session crashed. I followed the on-screen instructions and deleted the ‘/home/user/R/x86_64-pc-linux-gnu-library/3.4/00LOCK-robustlmm’ folder.
I then rebooted my computer and installed the package again in R. This time the R quit itself instead of giving me an error message that it crashed. When I booted up R again, I see that the package is listed among my installed packages, and I can run it.
The actual problem
Is there a way to check if a package in R has been installed correctly? That is, is there some checksum or similar thing for the package (I am not that computer-savvy so do excuse if the terminology is off), that can be compared to the repository in question? If so, how do I do it?
Edit
I uninstalled the package and installed it again. The same problem occured again.
I faced the same problem when installing "robustlmm". What I tried and it did not work:
Installing from the CRAN repository in RStudio (which is running on a Debian OS). Both the R session and RStudio have crashed.
Installing it from a downloaded tar.gz file in RStudio, which I downloaded from the CRAN page of the package. The same story happened again.
Installing in RStudio by donwloading directly from the github page using "devtools". Same result.
The solution: I managed to install the package by running R in a terminal and not through RStudio. The package runs OK now (also in RStudio).

RStudio Install Packages and Package Updates both download then fail with cannot open file

Running happily with R 3.4 and RStudio 1.0.143 under Win10 this problem occured bringing project development to a halt. Downloads each occur and are unzipped and then the a presumably first file in the first item gets:
Error in install.packages : cannot open file 'C:/Users/Admin/Documents/R/
win-library/3.4/file30504386b80/rJava/javadoc/resources/background.gif':
Permission denied
and the prompt returns.
Updating to R version 3.4.1 (2017-06-30), RStudio Version 1.0.153 was to no avail. Using the OS to remolve all R versions and trying again with 3.4.1 did not work. Removing R again and deleting the R directory to refresh the library did not work. My virius software like to tell how helpful it has been and has not, so that issue seems unlikely.
Giving the user full control of the R library did not help.
could package-updates be a tag like install-updates?
It looks there is a problem between Java and rJava.
You should try reinstalling Java using chocolatey package manager (https://chocolatey.org/) and then reinstall rJava package.
I had a similar issue two weeks ago on a windows laptop.
I had this problem for a long time. only in RStudio.
Install the package on R and Library it. Go to RStudio and require the package.
It works!

Resources