>> An opening curly brace should never go on its own line; > > I tend to do this: > > f <- function() > { > if (TRUE) > { > cat("TRUE!!\n") > } else { > cat("FALSE!!\n") > } > } > > (I don't usually put one-liners in if/else blocks; here I would have > used ifelse) > > I haven't seen many others format code in this way. Is there an > objective reason for this (such as the rule for the trailing "}") or > is this just aesthetics?
It's probably just aesthetics. I don't like it because it increases the number of lines without much real benefit - indenting already gives you all the hints you need. Hadley -- http://had.co.nz/ ______________________________________________ R-help@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.