Fundamentals3 / 12
Up next

Define a function

# functions are created with function()
add <- function(a, b) {
  # the last evaluated expression is returned
  a + b
}
print(add(2, 3))
What you're solving

function(), arguments, return value