[R] writing comments within a function

Ott Toomet otoomet at econ.dk
Fri Jun 6 13:05:02 CEST 2003


 | From: vincent.stoliaroff at socgen.com
 | Date: Fri, 6 Jun 2003 11:57:32 +0200

Hallo,

 | Hi R lovers!
 | 
 | I would like to know how you can write comments inside the code of a
 | function
 | 
 | is it latex style
 | % ?
 | or any other language style?

It's #, otherwise like tex.  The same character is used by gnuplot and
many configuration scripts and probably by many programming languages
too.

You may also consider

if(FALSE) {
...
}

But this "comment" must be syntactically correct.  You may also
consider emacs+ESS which includes possibilities to commenting and
uncommenting large program blocks.

I don't know where it is mentioned explicitly (I did not see it in "S
Programming" (a book)), but most examples include comments, I guess.

Best wishes,

Ott




More information about the R-help mailing list