Functional Programming in R