Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to change the default text editor in R when in Linux?

Tags:

linux

vi

r

I am programming using R in Linux and each time I want to edit a function by typing

fix(FunctioName)

The VI editor is used and for me, it is not that handy, I want to change it and make it an other one for example nano. I am connecting to our school server so I have only shell, no graphical interface.

Thank you in advance.

like image 923
sirus Avatar asked Jan 22 '23 01:01

sirus


2 Answers

Or in R, to override the environment variable:

options(editor = "nano")
like image 139
mdsumner Avatar answered Jan 23 '23 14:01

mdsumner


As always, export the desired editor in $EDITOR or $VISUAL before starting.

like image 38
Ignacio Vazquez-Abrams Avatar answered Jan 23 '23 16:01

Ignacio Vazquez-Abrams