R/compose.R

Defines functions compose

#' @export
#' 
compose <- 
function(.f, .g)
{
  f <- deparse(substitute(.f))
  g <- deparse(substitute(.g))
  h <- function(.) {}
  body(h) <- parse(text = paste0(f, "(", g, "(.))"))
  h
}


#' @export
#' 
"%.%" <- compose
paulponcet/funk documentation built on May 24, 2019, 10:32 p.m.