How do I resolve "no package called '.GlobalEnv'" error in R? - r

I'm getting a confusing error while using RStudio. When I use the command line, in the middle of typing a command (never while executing a command), R throws the following error:
Error in loadNamespace(name) : there is no package called ‘.GlobalEnv’
I am using R version 3.2.3 and RStudio version 0.99.491; I have tried to re-install RStudio and to delete settings.

Look at the tabs that open at startup.
In my case, it was because there was a debugging tab opened and RStudio was trying to load it at startup. I just closed it and that error stopped.

Related

R studio Javascript Alert R encountered a fatal error

Issue description
When opening R studio, after about 10 seconds, I get a popup alert:
Javascript Alert-http://127.0.0.1:40055/
R encountered a fatal error.
The session was terminated.
If I click the OK button on the alert I get another alert:
Javascript Alert-http://127.0.0.1:40055/
null
After clicking OK again, I get the error in the console:
Error: Unable to establish connection with R session
I cannot run anything (it just has the flashing cursor permanently). I cannot click any options (e.g. if I click Tools -> Global options, then the drop down closes without doing anything).
What I have tried
Restarting my computer.
Reinstalling R and R studio.
Removing the project and history files associated with the project.
Uninstalling all my packages (I presume unnecessary but I was getting desperate).
Moving the config file mv ~/.config/RStudio ~/backup-RStudio (from https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State). I also tried moving .rstudio-desktop, but that didn't exist.
Possibly useful information
The error first started after I tried to compile and run C code in R. I think I made an infinite loop, either way it crashed R and I xkilled it. R still runs fine from the terminal.
Versions
R version 3.6.3 (2020-02-29)
rstudio version 1.4.1103
Ubuntu 20.04.2 LTS
Any help would be much appreciated!
I had a very similar error message:
Javascript Alert: R encountered a fatal error. The session was
terminated.
For me this error occurred after changing from the 64-bit to 32-bit versions of R. I tried:
restarting my machine
uninstalling/reinstalling Rstudio
installing an older version of Rstudio which has been more stable in the past
None of these worked for me, but when I deleted my ".Rhistory" file in my home directory the error message disappeared and I'm now able to run my scripts again.
Additional info:
I'm using Windows 10, Rstudio Desktop 1.4.1717 and R4.1.0 (32 and 64 bit versions)
Update: Rstudio showed the same error message again, but resetting the RStudio Desktop's state helped.

Can't open R studio error "retrieving package installation contex"

I can't open r studio.
I tried to start R studio. First the statdart Windows error is appear
RStudio R Session has stopped working
I choose "Close the program". Then Rstudio starting with error
R encaunared fatal error
This session was terminated
But session continues. Next appear "null" and continues. After that appear error
retrieving package installation contex
It is continues long time. After hard closing of session the same situation is repeated.
Before that bad cicle R studio was closed with q() command. And computer was restarted.
How to exit from that cicle?
I replaced .Rhistory file (in working directory) with old version of the file and RStudio started correctly.

Rstudio-server won't start after updating to R 3.5.0: Error occured during transmission

I have recently moved from MRO 3.4.3 to R 3.5.0. I can start and use the new installation of R perfectly from the terminal, but when I stat Rstudio-server, an error panel appears with the message: "Error occured during transmission"
The log at /var/log/messages shows this:
Jun 6 11:28:51 slave1 rsession-victor[116037]: ERROR R SUICIDE: unable to initialize the JIT|||; LOGGED FROM: void<unnamed>::rSuicide(const std::string&) /root/rstudio/src/cpp/session/SessionMain.cpp:1023
I have tried to remove the files /etc/rstudio/rserver.conf and /etc/rstudio/rsession.conf that I had changed to use the previous MRO installation, but it didn't work. Also, I have tried to to remove completely the .rstudio folder in my home directory.
Any ideas about how to solve this?
Thanks!
I had the same problem after installing R 3.5.1 from sources.
The reason for the error is that libR.so is not build using the
simple installation procedure described in file INSTALL. RStudio
searches for this and finds an incompatible (old) one. Use this instead:
./configure --enable-R-shlib
make

Running into an error when attempting to load MASS Package in R Studio but it loads fine in base R

When I run library(MASS) I get the following error in R Studio:
Error in FUN(X[[i]], ...) :
cannot open file 'C:/Users/User/Documents/R/win-library/3.3/MASS/data/Rdata.rdb': No such file or directory
Yet it loads fine if I run the command in base R.
I can confirm as per the error message that the file (and the data folder) do not exist. But I've tried re-installing the MASS package (with apparent success) and it still doesn't appear to work.
I'm running R v3.3.1 both in base and in R Studio.
If it's not too burdensome, try removing RStudio and removing the RStudio-Desktop directory
https://support.rstudio.com/hc/en-us/articles/200554736-How-To-Uninstall-RStudio
https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-Desktop-s-State
After reinstalling RStudio, try importing MASS.

Error in fetch(key) : internal error -3 in R_decompress1

I have the following problem:
I have some development version of my package loaded in R session
I edited the source file.
I detach it and do:
system("R CMD check realizedvolatility")
system("R CMD build realizedvolatility")
system("R CMD install realizedvolatility_0.1.tar.gz")
library(realizedvolatility)
Until now, everything works. Now, if I try to bring up help file, for example ?realizedvolatility , the error
Error in fetch(key) : internal error -3 in R_decompress1
occurs.
The remedy is to restart entirely the R session, then everything works. Is there any way to make it work within one session? I tried detaching from namespace, installing with various options, nothing worked.
I am using Mac OS X Lion, and R 2.14.1
I asked the same question in R-help and one R core replied "this is by design" which means you cannot do anything about it except restarting R: https://stat.ethz.ch/pipermail/r-help/2011-July/283916.html (although I still do not understand why this design cannot refresh the cache database...)

Resources