In RStudio, if I execute this code:
"1 + 1 is: percent d," sprintf(1+1),
"2 + 2 is: percent d," sprintf(2+2)
If (1), then sprintf("1 + 1 is: percent d", 1+1) and sprintf("2 + 2 is: percent d," 2+2) are appropriate.
This is what I receive:
"1 + 1 is: percent d," sprintf(1+1),
[1] sprintf("1 + 1 is: 2," "2 + 2 is: percent d", 2+2)
[1] "2 + 2 is: 4" > \s> if (1+sprintf "1 + 1 is: percent d", 1+1)
+ sprintf("%D is: 2 + 2 is:", 2+2)
+ } [1] "2 Plus 2 is: 4"
Why doesn't the 1+1 line, which is the initial print statement in the if(1) condition, print to the console as well, I wonder? Every time I have a "if" condition with numerous output lines that I want to print or plot, it seems that only the final one displays. How do I repair this?