using_safely: 3 functions using_safely tag

Description Usage Arguments Details Examples

Description

tag ounterparts of purrr adverbs. These are not wrappers around purrr functions but contain some of their code, and have a similar interface). trying is an alias for using_possibly.

similar to purrr::quietly

similar to purrr::possibly

Usage

1
2
3
4
5
using_safely(.otherwise = NULL, .quiet = TRUE)

using_quietly()

using_possibly(.otherwise, .quiet = TRUE)

Arguments

.otherwise

Default value to use when an error occurs.

.quiet

Hide errors (TRUE, the default), or display them as they occur?

Details

similar to purrr::safely

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
using_safely$log(10, .otherwise = NA_real_)
using_safely$log("a", .otherwise = NA_real_)
using_safely(.otherwise = NA_real_)$log(10)
using_safely(.otherwise = NA_real_)$log("a")

using_quietly$sqrt(-1)
using_quietly$sqrt(4)

using_possibly$log("a", .otherwise = NA_real_)
using_possibly$log(10, .otherwise = NA_real_)

moodymudskipper/tags documentation built on June 25, 2019, 10:54 a.m.