What editor are you all using to write R code?  Many will have ways of doing 
what you want, e.g., comment-region (bound  by default to M-; through 
comment-dwim) in Emacs. 

-----Original Message-----
From: [email protected] [mailto:[email protected]] On 
Behalf Of Michael Knudsen
Sent: Wednesday, July 22, 2009 9:55 AM
To: Mark Knecht
Cc: r-help
Subject: Re: [R] Multi-line comments?

On Wed, Jul 22, 2009 at 4:30 PM, Mark Knecht<[email protected]> wrote:

>   I wanted to comment out 20 lines that I'm moving to a function but
> didn't want to delete them. Is there no defined way to get around
> using a # on each of the 20 lines?

Just like you, I have been longing for that myself. It seems that the
answer is negative, so I have ended up using

if (1==0)
{
   # code goes here
}

although is not really nice to look at.

-- 
Michael Knudsen
[email protected]
http://lifeofknudsen.blogspot.com/

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to