I am confused now! First I learned it is not possible in R, but I often forget it and it sometimes works. And then it doesn't work again! I start to recognize the pattern - it works in for loop or in another block statement, but not outside:
for (i in 1:10) {
if (0)
a <- 1
else
a <- 2
b <- 3
}
Doesn't make sense to me... any explanation? And manual reference? In every R resource I read it seemed like brackets are necessary:
if (0) {
a <- 1
} else {
a <- 2
}
PS: not a duplicate, the marked question don't even talk about the variant without brackets, which is core of my question. It is talking about the necessity of the line breaks.