maybe_do: will apply func to x if bool is TRUE. Saves us from an ugly...

View source: R/tokenify.R

maybe_doR Documentation

will apply func to x if bool is TRUE. Saves us from an ugly function

Description

will apply func to x if bool is TRUE. Saves us from an ugly function

Usage

maybe_do(x, bool, func, ...)

Arguments

x

anything really , just the first argument of func

bool

Boolean. applies function if bool is True

func

function that takes x and ...

...

passed to func

Examples

 maybe_do(c(2, 2,100), TRUE, function(x){x*2})
 maybe_do(c(2, 2,100), FALSE, function(x){x*2})


csps-efpc/TokenLink documentation built on Feb. 10, 2023, 3:30 a.m.