[R] Is there a construct for conditional comment?

Steve Jaffe sjaffe at riskspan.com
Thu Aug 20 17:54:03 CEST 2009

Why not

if ( 0 ) {
commented with zero
} else {
commented with one

Greg Snow-2 wrote:
> I believe that #if lines for C++ programs is handled by the preprocessor,
> not the compiler.  So if you want the same functionality for R programs,
> it would make sense to just preprocess the R file.
>> In C++, I can use the following construct to choice either of the two
>> blocks the comment but not both. Depending on whether the number after
>> "#if" is zero or not, the commented block can be chose. I'm wondering
>> if such thing is possible in R?
>> #if 0
>> commented with 0
>> #else
>> commented with 1
>> #endif
>> Regards,
>> Peng

View this message in context: http://www.nabble.com/Is-there-a-construct-for-conditional-comment--tp25034224p25064798.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list