--- title: "Functions 2" output: html_notebook --- ## Functions as Arguments ```{r} f_add <- function(x,y) { x + y } f_subtract <- function(x,y) { x - y } f_multi <- function(x,y) { x * y } operation<- function(FUN, x, y) { FUN(x , y) } a <- c(2,3,4) b <- c(1,2,3) operation(f_add, a, b) operation(f_subtract, a, b) operation(f_multi, a, b) ```