I realize this thread is a bit old, but it only just came to my mind. What about using a function like

commentOut <- function(expr) { invisible() }

and then

commentOut({
        a <- 10
        bladfkljasdlkfj()
        blah blah blah
})

Lazy evaluation prevents the expression from being evaluated so you don't have to worry about syntatic correctness. And it nests too (I believe).

Belated US$0.02.

-roger

A.J. Rossini wrote:
Greetings from Switzerland!

Are there any plans/initiatives/considerations in future versions of R
for commenting out regions via something like " /*    */  "?

(I've got an application for which something like that would be
useful; if not, there are less simple solutions).

best,
-tony

"Commit early,commit often, and commit in a repository from which we can easily
roll-back your mistakes" (AJR, 4Jan05).

A.J. Rossini
[EMAIL PROTECTED]

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


-- Roger D. Peng http://www.biostat.jhsph.edu/~rpeng/

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel

Reply via email to