constant_function_factory: Create a function returning a constant value

Description Usage Arguments Value Examples

Description

Create a function returning a constant value

Usage

1

Arguments

v

Constant value to be returned by the function

Value

A function returning a vector with constant value v and length equal to the input vector

Examples

1
2
3
fun = constant_function_factory(0)
# all values are TRUE
print(fun(1:10) == rep(0, 10))

citiususc/voila documentation built on May 13, 2019, 7:30 p.m.