Thanks to visit codestin.com
Credit goes to github.com

Skip to content
/ erify Public

R Package for Validation of Arguments and Generation of Readable Error Messages

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

flujoo/erify

Repository files navigation

erify logo

Check arguments, and generate readable error messages.

Installation

Install erify from CRAN:

install.packages("erify")

Or install the development version from Github:

# install devtools if not
# install.packages("devtools")

devtools::install_github("flujoo/erify")

Example

Load erify:

library(erify)

Check if the following argument is valid:

arg <- "I'm invalid."

For example, check if it has valid type:

check_type(arg, "integer")
#> Error: `arg` must have type integer.
#> 
#> ✖ `arg` has type character.

Check if it has valid length:

check_length(arg, 1)

Or check if it is a positive integer:

check_n(arg)
#> Error: `arg` must be a single positive integer.
#> 
#> ✖ `arg` has type character.

More

See vignette("erify", package = "erify") for a gentle introduction to erify.

About

R Package for Validation of Arguments and Generation of Readable Error Messages

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Languages