[R] Multi-line comments?

Barry Rowlingson b.rowlingson at lancaster.ac.uk
Wed Jul 22 17:07:44 CEST 2009


On Wed, Jul 22, 2009 at 3:30 PM, Mark Knecht<markknecht at gmail.com> wrote:
> Hi,
>   I looked in the language definition and was surprised. Is there
> really no multi-line/block comment defined in R?
>
>   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?

 Hmmm I think this might be a FAQ... Usual suggestions are:

 1. use an editor that can do un/commenting of regions.

 2. Stick it in an if(FALSE){ ... } block, but that's only good if
it's syntactically correct.

 I prefer:

 3. Manage your code under a decent SCM and don't fear the delete.

Barry




More information about the R-help mailing list