Code Is Poetry

Life is Binary

# if (condition) expr1 else expr2
x <- 2; y <- 10
if (x==0) y <- 0 else y <- y/x #
y

# for (variable in sequence) expr
x <- 3
ASum <- 0; AProd <- 1
for (i in 1:x)
{
  ASum <- ASum + i
  AProd <- AProd * i
}
ASum # equivalent to sum(1:x)
AProd # equivalemt to prod(1:x)