library(tidyverse) power1 <- function(exp) { function(x) { x ^ exp } } square <- power1(2) cube <- power1(3)