[R] how to comment off sections

Erik Iverson eriki at ccbr.umn.edu
Sat Jul 17 04:32:40 CEST 2010


On 07/16/2010 06:59 PM, Joshua Wiley wrote:
> Hello,
>
> Is there an way to easy comment of sections of code?  I was thinking
> something along the lines of
>
> \dontrun{
> codeline 1
> ....
> codeline k
> }
>
> but that could be used in regular script files.  When I am still
> working on a script, I often want to being using what is done, but I
> would like the parts I am still working on not to be run when I use
> source() on the file.  I can set everything off with #, but that gets
> to be tedious.

What editor do you use to edit R scripts?  Many will have a way to add a comment 
character to each line of a highlighted region of code with one command.



More information about the R-help mailing list