Compose: Compose multiple functions.

Description Usage Arguments Value See Also Examples

Description

In infix and prefix forms.

Usage

1
2
3
Compose(...)

.f %O% .g

Arguments

...

n functions to apply in order from right to left.

.f

A function.

.g

A function.

Value

A function that will apply each function in order from right to left.

See Also

Other function operators: Fail_With; Memoise; Partial; Reduce_Right

Examples

1
2
3
4
5
6
not_null <- `!` %O% is.null
not_null(4)
not_null(NULL)

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

Example output

[1] TRUE
[1] FALSE
[1] 10

functools documentation built on May 2, 2019, 5:39 a.m.