Pycharm IntelliJ R extension cannot find R interpreter - r

After opening a .R file in Pycharm and trying to run the R code, the error R Console Failure: Cannot run console until path to viable R interpreter is specified appears. The R language plugin is installed, as is R for the computer, but PyCharm File -Settings -Languages and Frameworks does not show R (screenshot ). RStudio runs the R code in the file without problems. PyCharm used to run it, but after closing and reopening PyCharm, the file no longer runs.
I did the Edit Configurations that PyCharm asked and specified a .R configuration: the file is my open file that I want to run, the file directory is the working directory.
The file in question is an existing file initially created in RStudio. It is not a PyCharm project.
Ubuntu 18.04 on Dell Latitude E 7470.

Restarting PyCharm worked for me.
I was working on a Python project. Then I decided to change to an R project, opened it, and then opened some R files in PyCharm. That's when the error appeared.
I restarted PyCharm and upon reopening it, the R files were all there and the R console was working.

I just encountered a similar problem. I think the issue was that when I created the project in Pycharm. I did not initially choose to create the project as an R Project or R Package. Not sure if it's possibly to work around this if the project was initially designed with Python.

Copying the R file to a folder with a previously working PyCharm project (with a main.R file) and then opening it in PyCharm, the code in the file ran. The problem was solved, but it reappeared after the computer went to sleep and was wakened.
The file in the folder of the working PyCharm project no longer ran, but generated the original error. Closing the file in PyCharm and reopening did not work. Closing PyCharm and then doubleclicking the file to open it and PyCharm together worked: the code in the file ran.

Related

RStudio package project R/hello.R file opens empty (no code showing) in console

I've created a new package project with RStudio but when I open .R files the source pane remains empty.
The tab shows that the file name is being registered, but none of the script appears.
When I open the hello.R file in a 'normal' project the contents of hello.R appear as expected.
I have tried reinstalling both R and RStudio and checked that windows 10 is up to date.
I'm using R version 4.2.0, RStudio 2022.02.2 Build 485, Rtools42 on a windows 10 OS
The same is true for a previous local package I have developed which I can no longer edit. The existing package works fine but when I open the .R files non of the code is displayed.
I'm hoping someone may have some ideas to resolve this or where to look to try to problem solve this.
My work round is to use a previous version of R: 4.1.3 in which case the scripts appear as expected in the source window.
Package project console
'Normal' project console

R Studio Unresponsive

The issue I have is R Studio being (pretty much) completely unresponsive. Codes are not being run and I am unable to create new projects, and R studio stalls out when trying to quit out, restarting, or terminating the session- please see screenshots. Literally nothing is working- I can't even open up a new, blank R script. I'm running R Studio on a 2015 MacBook. R Studio Stalling Notice the console ">" status symbol is not present.
I have tried the following suggestions but none have worked:
reinstalling R and R studio
Deleting the folder: /Users/[my username]/.rstudio-desktop --**** I CANNOT FIND THIS FOLDER- It doesn't exist???** suggestion from: https://stackoverflow.com/questions/34532328/couldnt-quit-r-session-or-couldnt-quit-rstudio** Folder missing!!!
Loading the suggested code in Terminal: /Applications/RStudio.app/Contents/MacOS/RStudio
Thanks so much for any insights,
LD
If you're on a mac these may be hidden files, try cmd + shift + . to see those hidden files.
I had to uninstall R, R studio, delete all .rdata and workspace files from my active directory as well as the .rstudio-desktop folder from my home directory as well

RStudio not showing code in Rmd file, while Notepad does

I'm currently running into an issue of a .Rmd file opening in RStudio without actually populating the Source pane with the code. The file was written in RStudio, and the code shows up when I open the file in Notepad (and copies with the right formatting), but there's nothing showing up inside of RStudio.
Has anyone run into this issue before or have a good fix?
I had this same challenge too. I had to install Rstudio directly from CRAN and it works now, this issue probably happens with R studio installed via Anaconda.

No code displayed when I open the compiled R notebook

I am using R Studio V 1.1.423. I create and save R Notebook files but once I open the .rmd files in R Studio I only get a completely blank page with no code displayed.
However the html files work fine when opened in the browser.
Any suggestions would be really appreciated.
This seems to be a bug in RStudio: It happens every once in a while. It usually helps to delete the R Notebook output (the .nb.html file) and to recompile it from scratch.
You might also have to clear the cache, which can be found (on Unix-like systems) in ~/.rstudio-desktop/notebooks:
Close RStudio.
Find the subfolder corresponding to your notebook and delete it. The subfolder contains a quasi-random hexadecimal prefix, followed by your notebook name; for instance: A88D397F-notebook.
Reopen RStudio and recompile your notebook from scratch.

Repair corrupted Jupyter notebook / load previous version?

I had a hardware crash while running a Jupyter notebook. After repairing the system and trying to restart the notebook, I got the following error message:
Error loading notebook
Unreadable Notebook: D:\Eddy\Documents\1604 Udacity\1612 Self-driving car Nanodegree\P4\P4 Eduard van Kleef.ipynb NotJSONError("Notebook does not appear to be JSON: ''...",)
Does anyone know of a way to revert to any of Jupyter's previous 'checkpoints'? Or of a way to at least partially restore a JSON?
If you are lucky then the ipynb file is corrupted but still there. In that case you can try opening it in a text file and copying the contents to a new notebook. But check the size of the file. If it is zero bytes, then there is nothing there!
This actually happened to me when my server ran out of memory and somehow the notebook got completely erased. Totally sucks.
Try this
jupyter nbconvert filename.ipynb --clear-output
It worked for me since it has corrupted because of Plotly behavior with some big data.
in your file directory that contains your ipynb file there is a folder called '.ipynb_checkpoints'. this folder does not show in the jupyter application so find it through windows explorer.
inside there's will be a file called urfilenamehere-checkpoint.ipynb
copy paste it to your file directory and open through the jupyter application it should probably work.
if your corrupted file is 0B, you definitely have to rely on the checkpoints.
do not create a new notebook with the same name it will overwrite the checkpoint.

Resources