call_safe: Call a Function Given an External Dependency on Non-Windows...

View source: R/call.R

call_safeR Documentation

Call a Function Given an External Dependency on Non-Windows Systems

Description

Just a specialized version of call_conditionally.

Usage

call_safe(f, dependency, fallback = "Fallback", ...)

Arguments

f

The function passed to do.call.

dependency

The external dependency, see Examples.

fallback

See Description.

...

arguments passed to do.call.

Value

The return value of f or fallback.

See Also

Other call functions: call_conditionally()

Examples

call_safe(whoami::email_address, dependency = "whoami",
          args = list(fallback = "foobar@nowhere.com"),
          fallback = "nobar@nowhere.com")
call_safe(whoami::email_address, dependency = "this_is_not_installed",
          args = list(fallback = "foobar@nowhere.com"),
          fallback = "nobar@nowhere.com")

fritools documentation built on Nov. 19, 2023, 1:06 a.m.