R: Compose multiple functions

compose {purrr} | R Documentation

## Compose multiple functions

### Description

Compose multiple functions

### Usage

    compose(...)

### Arguments

`...` | n functions to apply in order from right to left.

### Value

A function

### Examples

    not_null <- compose(`!`, is.null)
    not_null(4)
    not_null(NULL)

    add1 <- function(x) x + 1
    compose(add1, add1)(8)

[Package purrr version 0.2.4 Index]