datacamp-logo

Function output

Consider the following function that takes a numeric value, x, as input:

f <- function(x) {
  if (TRUE) {
    return(x + 1)
  }
  x
}

What will be the result of calling f(2)?

Answer the question
50 XP
Possible Answers
  • press
  • press
  • press