[R] Block comments in R?
Stefano Calza
stecalza at tiscali.it
Fri Oct 6 12:55:38 CEST 2006
And of course in emacs you can select the region to comment then hit
Ctrl-x r t and type #: all the lines in that region will have a # at the
beginnig
To uncomment Ctrl-x r d
Stefano
On Fri, Oct 06, 2006 at 07:05:52PM -0400, Jim Lemon wrote:
<Jim>And of course for NEdit, all one needs to do is select:
<Jim>
<Jim>Preferences | Default Settings | Customize menus | Macro Menu
<Jim>
<Jim>Then select the "New" option at the top of the menu list,
<Jim>
<Jim>Give it a name (I call this r_comment),
<Jim>
<Jim>Enter the following code:
<Jim>
<Jim>replace_in_selection("^","#","regex")
<Jim>
<Jim>click on "Apply" and then "OK"
<Jim>
<Jim>You will have an item named "r_comment" on your macro menu
<Jim>
<Jim>Simply select the area you wish to comment out and run the macro.
<Jim>
<Jim>To remove comments, you can program another macro (r_nocomment)
<Jim>
<Jim>replace_in_selection("#","")
<Jim>
<Jim>You can give both of these a keystroke invocation if you wish.
<Jim>
<Jim>Happy commenting!
<Jim>
<Jim>Jim
<Jim>
<Jim>______________________________________________
<Jim>R-help a stat.math.ethz.ch mailing list
<Jim>https://stat.ethz.ch/mailman/listinfo/r-help
<Jim>PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
<Jim>and provide commented, minimal, self-contained, reproducible code.
More information about the R-help
mailing list