[R] Multi-line comments?

Erik Iverson eiverson at NMDP.ORG
Wed Jul 22 17:27:56 CEST 2009


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: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] 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<markknecht at gmail.com> 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
micknudsen at gmail.com
http://lifeofknudsen.blogspot.com/

______________________________________________
R-help at r-project.org 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.




More information about the R-help mailing list