[R] Is there a way....

François Pinard pinard at iro.umontreal.ca
Wed Apr 26 14:09:16 CEST 2006


[Levent TERLEMEZ]

>I would like to get rid of counting lines in fix() when i made 
>a mistake in coding? Is there an easy way to an line numbers to editor?

You may configure R to use the editor you want, the way you want.  For 
example, if you want fix() to start Vim in graphical mode, highlighting 
file contents using R syntax, and numbering source lines, you might use
the following R command:

    options(editor = "gvim -c \"set nu\" -c \"set ft=r\"")

Of course, how to do this much depends on each editor.  Some simpler 
editors may not have options for displaying the line number on each 
line.  Yet, most keep the line counter for the cursor position updated 
in some mode or status bar, so if nothing better, you can learn to 
position the cursor while keeping an eye on that. :-)

Once you find the proper incantation for your editor, and if you always 
want it activated, save the R command within your ~/.Rprofile file.


P.S. - By the way, much congratulations and thanks to the R Core team 
for the recent publication of R 2.3.0.

-- 
François Pinard   http://pinard.progiciels-bpi.ca




More information about the R-help mailing list