Why the output of this if statement is the last expression, only?
if (2==2) {
a <- 3+4;
b <- 3+5;
c <- 3+6;
a;
b;
c
}
The output is only the “c” variable value:
[1] 9
The R help Control {base} states:
Arguments: expr, cons.expr, alt.expr, x, y
An expression in a formal sense. This is either a simple expression or a so-called compound expression, usually of the form { expr1 ; expr2 }.
How can I get all the three variables (“a”,”b”,”c”) values (7,8,9) in the output?
Thanks in advance