[R] how to comment off sections

Joshua Wiley jwiley.psych at gmail.com
Sat Jul 17 02:05:43 CEST 2010


That's a great idea.  Thanks!

On Fri, Jul 16, 2010 at 5:02 PM, RICHARD M. HEIBERGER <rmh at temple.edu> wrote:
> if (FALSE)  {
> codeline 1
> ....
> codeline k
> }
>
>
> On Fri, Jul 16, 2010 at 7:59 PM, Joshua Wiley <jwiley.psych at gmail.com>
> wrote:
>>
>> Hello,
>>
>> Is there an way to easy comment of sections of code?  I was thinking
>> something along the lines of
>>
>> \dontrun{
>> codeline 1
>> ....
>> codeline k
>> }
>>
>> but that could be used in regular script files.  When I am still
>> working on a script, I often want to being using what is done, but I
>> would like the parts I am still working on not to be run when I use
>> source() on the file.  I can set everything off with #, but that gets
>> to be tedious.
>>
>> Thanks,
>>
>> Josh
>>
>> --
>> Joshua Wiley
>> Ph.D. Student, Health Psychology
>> University of California, Los Angeles
>> http://www.joshuawiley.com/
>>
>> ______________________________________________
>> R-help at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-help
>> PLEASE do read the posting guide
>> http://www.R-project.org/posting-guide.html
>> and provide commented, minimal, self-contained, reproducible code.
>
>



-- 
Joshua Wiley
Ph.D. Student, Health Psychology
University of California, Los Angeles
http://www.joshuawiley.com/



More information about the R-help mailing list