0

my R function is
f2 <- function(x) { ifelse ( x > 50, print ("greater") , print("less") ) };

I test the function using below code :

x<- c( 52, 49, 93, 31, 14);
f2(x);

This is the output I see

[1] "greater"
[1] "less"
[1] "greater" "less"    "greater" "less"    "less" 

Question: what are the first two lines of the output ? I only expected the last line.

RKA
  • 221
  • 3
  • 14

0 Answers0