jonathan_li@agilent.com
2001-Oct-10 18:43 UTC
[R] How to comment out multiple lines in R source code?
Hi, Is there a way to comment out multiple lines at once in R source code like C language's /* */ struct? This is quite useful when one is testing different sections of a source code. Thanks, Jonathan -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
A.J. Rossini
2001-Oct-10 18:55 UTC
[R] How to comment out multiple lines in R source code?
>>>>> "jl" == jonathan li <jonathan_li at agilent.com> writes:jl> Hi, Is there a way to comment out multiple lines at once in R jl> source code like C language's /* */ struct? This is quite jl> useful when one is testing different sections of a source jl> code. One alternative is to use editor macros for this. (X)Emacs, when using ESS, supports comment-region and uncomment-region commands. best, -tony -- A.J. Rossini Rsrch. Asst. Prof. of Biostatistics U. of Washington Biostatistics rossini at u.washington.edu FHCRC/SCHARP/HIV Vaccine Trials Net rossini at scharp.org -------- (fridays are probably at Rosen) -------- FHCRC: M-W: 206-667-7025 (fax=4812)|Voicemail is pretty sketchy/use Email UW: T-Th: 206-543-1044 (fax=3286)|Change last 4 digits of phone to FAX -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Emmanuel Paradis
2001-Oct-11 13:22 UTC
[R] How to comment out multiple lines in R source code?
At 07:33 11/10/01 +0100, Prof Brian D Ripley <ripley at stats.ox.ac.uk> wrote:>On Wed, 10 Oct 2001, [iso-8859-1] G?ran Brostr?m wrote: > >> On 10 Oct 2001 rossini at blindglobe.net wrote: >> >> > >>>>> "jl" == jonathan li <jonathan_li at agilent.com> writes: >> > >> > jl> Hi, Is there a way to comment out multiple lines at once in R >> > jl> source code like C language's /* */ struct? This is quite >> > jl> useful when one is testing different sections of a source >> > jl> code. >> > >> > One alternative is to use editor macros for this. >> > >> > (X)Emacs, when using ESS, supports comment-region and uncomment-region >> > commands. >> > >> > best, >> > -tony >> >> You may also try >> >> if (FALSE){ >> ... >> ... >> } > >Yes, you will see that in e.g. the MASS scripts to comment out S code that >does not (yet) work in R. > >One warning: in that method the `commented' code has to syntactically >valid, and that has caught me more than once. So I usually use ESS's >methods.In (X)Emacs, you can add a character at the beginning of several lines at once by selecting a block of lines, and then typing C-x r t # (where you can replace # by any other character or even a string; `C-x' means `Ctrl-x'). This does not need ESS. You can even add the # in the middle of the lines if your block selection starts at this point (in case you want to comment out the right hand-side of a command... maybe not very usual). BTW, the possibility to (un)comment out a block a R commands does not appear in the ESS menu (it does in C-mode), and I did not find it in ESS's doc (but I admit I did not read it all carefully). Emmanuel Paradis Emmanuel Paradis Laboratoire de Pal?ontologie Institut des Sciences de l'?volution Universit? Montpellier II F-34095 Montpellier c?dex 05 France phone: +33 4 67 14 39 64 fax: +33 4 67 14 36 10 mailto:paradis at isem.univ-montp2.fr -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._