After updating R the code is not displayed anymore - r

So, I updated R using the installr package in the Rgui. Now I face two problems:
My previously written code is not displayed anymore - the file is not empty, I checked it by opening the file with the editor. Opening the file by regular double clicking (RStudio is default application) as well as open the file within Rstudio by using File -> Open File -> Filename did not help. It does open the file but shows it as an empty file (no code is displayed).
When loading packages, I get the request for updating my RStudio. But when I use the taskbar (Help -> check for Updates) it says, that the RStudio uses the newest version.
After updating I also restarted my computer, which did no help. I also checked if the newest version is actual in use as suggested in the following post Mismatch Versions.
Any idea what I am doing wrong and how to display the code again? Thanks!
Update: The problem was solved by installing the newest RStudio version directly from their website.

Meanwhile, I found the solution - the true root of the problem was in fact an old version of RStudio. Besides in RStudio it was declared as the newest version, here it was mentioned that these statements are not always correct.
Downloading the newest version directly from the RStudio website solved the problem.

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

How do I open an r script (.R file) in RStudio by double-clicking it in windows

When I double click an R script (.R file) in order to open and edit it, nothing happens.
I expect it to open it in either R or RStudio but it doesn't.
I found a similar (old) question (Opening a .R file via a double click (Windows)) but the solution doesn't work for me.
I have tried:
- right-clicking and explicitly telling it to open it with RStudio
- set it as the default program to associate with this file type
- drag the script into RStudio
Anyone any idea whether it is Windows or R(Studio) related?
Running:
Windows 10 Pro
R version 3.6.1
RStudio version 1.2.1335
As the first comment suggest, it is likely a problem occuring while installing R or Rstudio. This would most likely be fixed by reinstalling Rstudio. If it doesnt i'd suggest checking out this Rstudio question.
Basically, you can manually create using the command prompt (start -> "cmd" -> enter), using
assoc .R=rfile
Ftype rfile="C:\Program Files\RStudio\bin\rstudio.exe" %1
changing the rstudio directory to the correct directory for your computer.
A less command-prompty solution might be available by following the steps described in this guide. However i did not test the latter approach.

RStudio empty on startup - No windows, no menus, no rendering

When I start RStudio, none of the windows inside the main frame come up, and none of the menu options display menu options when clicked. It's just an blank page.
It feels like some kind of graphics rendering or window management problem.
I'm running Windows 7. I have the latest version of R, which is 3.1.1. I have the latest RStudio, which is 98.1062.
How to fix it?
Reset the RStudio state. Do this:
Close RStudio if open.
Go to this directory: %localappdata%\RStudio-Desktop
Rename that directory as a type of backup.
Start RStudio.
RStudio will see the configuration directory is missing and regenerate it with correct values.
Everything should work after that.
Other threads I found helpful here are:
https://support.rstudio.com/hc/en-us/articles/200534577-Resetting-RStudio-s-State
https://support.rstudio.com/hc/communities/public/questions/200666647-RStudio-096-16-Windows-7-gives-empty-screen?locale=en-us
Thanks!
Renaming the RStudio state by renaming %localappdata%\RStudio-Desktop did not work for me. However i made it work by renaming another config folder in %appdata% instead.
Close RStudio
Go to this directory: %appdata%\RStudio
Rename the folder
Restart RStudio
I faced the same issue when I downgraded my version of R.
I did try the above solutions. However, it didn't work for me.
After some googling, I found out that the issue was because now I had a different version of R installed. Here's how you can choose the version of R and rectify the issue.
Navigate to the RStudio installation folder. (C:\Program Files\RStudio\bin)
Press and hold Control Key
Double click on rstudio.exe
Choose a specific version of R (whichever you want to work with)
Click OK and RStudio should open without any issues.
NB: I use 64bit Windows 8.1.
I had the same issue and I almost gave up about solving it but then I found a suggestion that GitHub might be the problem. I am not sure how that is happening but the minute I uninstalled GitHub and re-launched Rstudio, it worked perfectly as nothing happened!? Here is the link for where I found the suggestion on Rstudio community page: (https://support.rstudio.com/hc/communities/public/questions/200983187-R-studio-0-98-797-for-mac-opens-as-blank-white-page)
I had the same problem and figured out that for some reason R was blocked on the step of loading my library from a website (I added it to Rprofile for auto-load). You can test the following:
1) Try to run just R console, not RStudio, and then click on blank space - normally some information should appear
2) Try to launch without network connection
On a Mac (Running Yosemite 10.10.3) this is what worked for me:
Move/Rename ~/.rstudio-desktop
(Many responses have mentioned this, but this by itself didn't help.)
Then I shutdown my Mac and restarted it. RStudio worked when I logged back in.
Before that, I tried every one of the steps mentioned here and in many other links, including re-downloading R and RStudio, but unfortunately none of those steps helped in my case.
Search this documentation for 'Blank GUI'.
This is what I found which worked for me:
In Windows Explorer, go to C:\Users\currentUser\AppData\Roaming\RStudio.
Delete the Desktop.ini file
This technique forces RStudio to refresh and default to open-source R as the engine
Same issue I faced so I unistalled the windows installer and downloaded zip version from this link https://www.rstudio.com/products/rstudio/download/
Unziped It and pasted it into c drive and created shortcut from Rstudio/bin/rstudio.exe file.
Working properly after that no issue. In windows installer checked that r session is not working due to an missing dll.
So try to install from ZIP
I had the same problem like Thomas
When I start RStudio, none on the windows inside the main frame come up, and none of the menu options display menu options when clicked. It's just an blank page.
My problem was, that i uninstalled R because is thought RStudio will work on its own.
So i uninstalled RStudio and deleting every existing file which was created by R or RStudio.
In the next step i installed RStudio again.
It was asking for a Version of R (which i dont had in this state). So i installed R again and everything is working fine now. I hope this helps
I had a slight variation of the problem that might be of interest. I had set up an aliases.cmd to run my cygwin bash shell automatically upon launch of a cmd terminal as per:
https://superuser.com/questions/302194/automatically-executing-commands-when-a-command-prompt-is-opened
What RStudio was doing was launching a few cmd windows in the background to (I assume) populate each pane and the console.
This was triggering a bash shell which wasn't returning and was hanging RStudio.
If you have this issue you can just manually kill the sub bash terminals spawned by cmd via ProcessExplorer/TaskManager and RStudio will continue to launch normally.
If anyone else has set anything to launch automatically on init of a cmd terminal then this could interfere in the same way with RStudio.
The RStudio devs could probably fix this behind the scenes by changing the way they spawn cmd terminals in the gui.
I had a similar problem. After trying the options above with no luck, I uninstalled Rx64 3.5.0 and installed an older version, R x64 3.2.2.
Rstudio then worked perfect.

Lyx 2.1 RC1, warning message "the selected document class Article" requires external files

I just installed 2.1 RC1 bundle on windows 7
Each time I try to save a document (also when I first open Lyx), I get this message
LyX-210RC1-Bundle-1.exe
why this happens? Do I need to configure something else? I had Lyx 2.0 before, but I uninstalled that before installing Lyx 2.1
I also got this message. For me, this is what I think was going on:
The first execution of Lyx very quietly (i.e., in the background) performs package updates for MiKTeX. Afterwards, it actually launches Lyx.
However, if you launch a second invocation of Lyx immediately after the first (since nothing has yet displayed), it will launch w/o the packages it requires and result in the message that you see.
I suppose if MiKTeX was not / improperly installed, you could also encounter this issue.
#scottkosty is right--this should not happen and having downloaded the latest version of LyX 2.1.1. I had the same problem (NOTE: I am, however, working on a Mac). These are the steps I took to finally get things working in my case:
If you have the above issues working on a Mac with OS X try the following:
1. reinstall latest version MacTeX at: [https://tug.org/mactex/][1]
2. install latest version of LyX: 2.1.1. (see: [http://www.lyx.org/Download][2])
3. Tools --> Reconfigure.
4. Restart, check: Document --> Settings --> Document Classes: these should now be available.
i had a similar problem but I believe I sorted it. If you can get someone to send you their 'templates' folder (i just put my one from my old laptop on googledrive), then go to lyx, go preferences, go paths, and then set the path to go to the location of your new templates folder. I then restarted it and it worked! Hope it helps :)

Error in readRDS(file) : unknown input format

I am trying to install custom packages in my Rprofile.site file. I want to install packages in the site file because I have to install these packages on several users' computers. However, I am getting the following the error whenever I launch R.
Error in readRDS(file) : unknown input format
I have the following code added to the end of my Rprofile.site file.
if(length(grep("customPackage", installed.packages()))==0) {
install.packages("customPackage", repos=NULL, type="source")
}
The error keeps repeating itself as well until I stop the R session. If I remove that code from the site file and just install the package directly in an R session though it works fine.
The only reason I want to do it in the site file is because I will keep adding more custom packages that need to be installed on each user's machine and I would rather just call it from the site file than have each user install each custom package once.
I tried searching for the error and got a variety of answers which spoke about deleting the .Rhistory file (which I tried, but didn't work), or installing the latest version of R (I am on R-2.15.0 which is the latest version so that won't help either). I was wondering if there was any other solution to fixing this problem.
I had the same error. Simply closing RStudio, then reopening it and trying again is what worked for me. Note that restarting the R session via the RStudio menu or via rs.restartR() didn't work - only closing and reopening RStudio worked. Not sure why.

Resources