Change default editor in RStudio to notepad ++

I would like to change the default editor in RStudio (Windows 7) to Notepad ++.

I know what I should use

options(editor = "notepad") 

and then run for example:

 mean <- edit(mean) 

but when I print notepad ++, I get this error

 options(editor = "notepad++") mean <- edit(mean) Error in edit(name, file, title, editor) : unable to run editor 'notepad++' 

I Windows I can start notepad ++ in the console by typing "start notepad ++".

I will be very grateful for your help!

Here is my session information:

 > sessionInfo() R version 2.15.2 (2012-10-26) Platform: x86_64-w64-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Polish_Poland.1250 LC_CTYPE=Polish_Poland.1250 LC_MONETARY=Polish_Poland.1250 [4] LC_NUMERIC=C LC_TIME=Polish_Poland.1250 attached base packages: [1] stats graphics grDevices utils datasets methods base loaded via a namespace (and not attached): [1] tools_2.15.2 
+6
source share
2 answers

Well, that was very simple:

 options(editor = "C:/Program Files (x86)/Notepad++/notepad++.exe") 

Sorry for the problem.

+10
source

For anyone who wants this, you can permanently change the setting for all R workspaces by going to 'R_HOME/etc/Rprofile.site' , where R_HOME is the directory that he installed. After finding the Rprofile.site file Rprofile.site open it in Notepad ++ and change the following:

 # options(papersize="a4") options(editor="notepad") # options(pager="internal") 

in

 # options(papersize="a4") options(editor="C://Program Files (x86)//Notepad++//notepad++.exe") # options(pager="internal") 

Save the file and you're done.

+1
source

All Articles