Max Kuhn wrote:
Perhaps this is obvious, but Ive never understood why this is the
general convention:
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)
... where you certainly know that ifelse evaluates both cases (if and
else) and hence might be less efficient for scalar valued problems?
Uwe Ligges
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?
Thanks,
Max
______________________________________________
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.
______________________________________________
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.