[R] Block comments in R?

Peter Dalgaard p.dalgaard at biostat.ku.dk
Thu Oct 5 16:12:50 CEST 2006


Seth Falcon <sfalcon at fhcrc.org> writes:

> Uwe Ligges <ligges at statistik.uni-dortmund.de> writes:
> > Use an editor that comments out a whole block which is what I do all the 
> > time, e.g. use Tinn-R, Emacs or WinEdt, to mention just a few of
> > them.
> 
> This, of course, works.  The if(FALSE) approach does not because it
> requires the "comment" to be syntactically correct.  The multiline
> string trick is _almost_ there, the problem is that both " and ' are
> fairly common in text and having to escape that is a pain.  
> 
> My wtf feature request is to add a multiline string delimiter ala
> Python like """.

Still gives you problems with nested comments. *IF* we want to go down
that route, we should have directional symbols like

<<<
dsaldfysdfk
>>>

(which would likely drive version control users up the wall...)

or 

/# kdlsfk 
   dfkjsdfl #/

(but those character combinations have a marginal risk of being used
in existing code).

-- 
   O__  ---- Peter Dalgaard             Øster Farimagsgade 5, Entr.B
  c/ /'_ --- Dept. of Biostatistics     PO Box 2099, 1014 Cph. K
 (*) \(*) -- University of Copenhagen   Denmark          Ph:  (+45) 35327918
~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk)                  FAX: (+45) 35327907



More information about the R-help mailing list