1

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

  • 2
    It's a problem with your file associations in windows. I'm not having any issues on the same platform, although running RStudio 1.1.463. Check file associations in windows setting, or try reinstalling – Johann Sep 16 '19 at 14:11

1 Answers1

1

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.

Oliver
  • 8,169
  • 3
  • 15
  • 37
  • 1
    I checked the file association in Windows, that was set correctly already. Luckily, reinstalling RStudio fixed the problem. Thanks for your help! – Jonas van Nijnatten Sep 17 '19 at 11:57