# chk_file
try(chk_file(tempfile()))
#> Error in eval(expr, envir, enclos) :
-#> `tempfile()` must specify an existing file ('/tmp/RtmpFgBJYx/file181b1a92e14' can't be found).
+#> `tempfile()` must specify an existing file ('/tmp/RtmpCk3GLQ/file181b576bce7d' can't be found).
# vld_file
vld_file(tempfile())
#> [1] FALSE
diff --git a/search.json b/search.json
index 02ea2c36..48fc4d13 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":[]},{"path":"/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement [INSERT CONTACT METHOD]. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/ code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to chk","title":"Contributing to chk","text":"outlines propose change chk.","code":""},{"path":"/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to chk","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to chk","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed).","code":""},{"path":"/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to chk","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"\", fork = TRUE). Install development dependences devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. Begin commit merge messages - indicate user facing changes included NEWS.md. use fledge automatically generate NEWS.md file.","code":""},{"path":"/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to chk","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to chk","text":"Please note chk project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 Poisson Consulting Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"/SUPPORT.html","id":null,"dir":"","previous_headings":"","what":"Getting help with chk","title":"Getting help with chk","text":"Thanks using chk! filing issue, places explore pieces put together make process smooth possible.","code":""},{"path":"/SUPPORT.html","id":"make-sure-its-new","dir":"","previous_headings":"","what":"Make sure its new","title":"Getting help with chk","text":"opening new issue, sure search issues pull requests make sure bug hasn’t reported /already fixed development version. default, search pre-populated :issue :open. can edit qualifiers (e.g. :pr, :closed) needed. example, ’d simply remove :open search issues repo, open closed.","code":""},{"path":"/SUPPORT.html","id":"make-a-reprex","dir":"","previous_headings":"","what":"Make a reprex","title":"Getting help with chk","text":"Start making minimal reproducible example using reprex package. haven’t heard used reprex , ’re treat! Seriously, reprex make R-question-asking endeavors easier (pretty insane ROI five ten minutes ’ll take learn ’s ). additional reprex pointers, check Get help! section tidyverse site.","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":"/articles/chk-families.html","id":"check","dir":"Articles","previous_headings":"","what":"Check","title":"chk Families","text":"Functioncheck_data(x, values = NULL, exclusive = FALSE, order = FALSE, nrow = numeric(0), key = character(0)) check_dim(x, dim = length, values = numeric(0), dim_name = NULL) check_key(x, key = character(0), na_distinct = FALSE) check_names(x, names = character(0), exclusive = FALSE, order = FALSE) check_values(x, values)","code":""},{"path":"/articles/chk.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Get Started with chk","text":"chk R package developers check user-supplied function arguments. designed simple, customizable fast.","code":""},{"path":"/articles/chk.html","id":"chk_-functions","dir":"Articles","previous_headings":"Introduction","what":"chk_ Functions","title":"Get Started with chk","text":"chk_ functions check properties individual objects. example chk_flag(x) checks whether x flag, .e., non-missing logical vector length 1. chk_ functions called side-effects, .e., throw informative error object fails check. Although return invisible copy first argument can used pipes. error messages, follow tidyverse style guide, designed allow user quickly identify problem argument value(s) providing. errors rlang errors subclass 'chk_error'.","code":"library(chk) y <- TRUE chk_flag(y) y <- NA chk_flag(y) #> Error: #> ! `y` must be a flag (TRUE or FALSE)."},{"path":"/articles/chk.html","id":"vld_-functions","dir":"Articles","previous_headings":"Introduction","what":"vld_ Functions","title":"Get Started with chk","text":"chk_ function matching vld_ function returns flag indicating whether object passed check. vld_ functions allow developers provide error messages.","code":"vld_flag(TRUE) #> [1] TRUE vld_flag(NA) #> [1] FALSE if (!vld_flag(NA)) abort_chk(\"`NA` is not TRUE or FALSE!!\") #> Error: #> ! `NA` is not TRUE or FALSE!!"},{"path":"/articles/chk.html","id":"using-chk","dir":"Articles","previous_headings":"","what":"Using chk","title":"Get Started with chk","text":"chk_ functions designed used within functions. Consequently, constructing error message use name object received expected name argument. case, developers can provide different name using x_name argument. IMPORTANT NOTE chk_ (vld_) functions expected directly exposed users don’t check arguments (object interest course!) ensure fast possible.","code":"fun1 <- function(x) { chk_whole_number(x) # use x } fun1(1) y <- 1.3 fun1(x = y) #> Error in `fun1()`: #> ! `x` must be a whole number (non-missing integer scalar or double equivalent). x <- NA chk_flag(x, x_name = \"`zzz`\") #> Error: #> ! `zzz` must be a flag (TRUE or FALSE)."},{"path":"/articles/chk.html","id":"extending-chk","dir":"Articles","previous_headings":"","what":"Extending chk","title":"Get Started with chk","text":"chk_flag() function illustrates general structure chk_ function. chk_ function initially checks object (using vld_ partner) object passes check immediately returns invisible copy object. , , object fails check chk_ function construct throw informative error message. deparse_backtick_chk() abort_chk() functions exported make easy programmers develop chk_ functions. chk-lgl.R script illustrates general template use developing chk_ functions.","code":"chk_flag #> function(x, x_name = NULL){ #> if(vld_flag(x)) return(invisible(x)) #> if(is.null(x_name)) x_name <- deparse_backtick_chk(substitute(x)) #> abort_chk(x_name, \" must be a flag (TRUE or FALSE)\") #> } #> #> "},{"path":"/articles/chk.html","id":"abort_chk","dir":"Articles","previous_headings":"Extending chk","what":"abort_chk()","title":"Get Started with chk","text":"abort_chk() function converts multiple arguments string using paste0(..., collapse = '') provides number sensitive sprintf-like types. default also capitalizes first character adds missing period.","code":"abort_chk(\"There %r %n problem director%y%s.\", n = 1) #> Error: #> ! There is 1 problem directory. abort_chk(\"there %r %n \", \"problem director%y%s\", n = 2) #> Error: #> ! There are 2 problem directories."},{"path":"/articles/chk.html","id":"check_-functions","dir":"Articles","previous_headings":"Extending chk","what":"check_ Functions","title":"Get Started with chk","text":"check_ functions complex chk_ functions make slower makes general tests easier.","code":""},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Joe Thorley. Author, maintainer. Kirill Müller. Author. Ayla Pearson. Author. Nadine Hussein. Contributor. Evan Amies-Galonski. Contributor. Poisson Consulting. Copyright holder, funder.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Thorley J, Müller K, Pearson (2023). chk: Check User-Supplied Function Arguments. R package version 0.9.1, https://github.com/poissonconsulting/chk.","code":"@Manual{, title = {chk: Check User-Supplied Function Arguments}, author = {Joe Thorley and Kirill Müller and Ayla Pearson}, year = {2023}, note = {R package version 0.9.1}, url = {https://github.com/poissonconsulting/chk}, }"},{"path":"/index.html","id":"chk-","dir":"","previous_headings":"","what":"Check User-Supplied Function Arguments","title":"Check User-Supplied Function Arguments","text":"chk R package developers check user-supplied function arguments. designed simple, customizable fast.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Check User-Supplied Function Arguments","text":"install latest release CRAN install latest development version GitHub","code":"install.packages(\"chk\") # install.packages(\"remotes\") remotes::install_github(\"poissonconsulting/chk\")"},{"path":"/index.html","id":"demonstration","dir":"","previous_headings":"","what":"Demonstration","title":"Check User-Supplied Function Arguments","text":"chk provides simple commonly used checks (chk_ functions) can combined together complex checking. used inside functions test user-provided arguments. Error messages follow tidyverse style guide errors rlang errors class chk_error.","code":"library(chk) y <- \"a\" chk_string(y) chk_flag(y) #> Error: #> ! `y` must be a flag (TRUE or FALSE). data <- data.frame(x = 1:2) chk_range(nrow(data), c(3, 8)) #> Error: #> ! `nrow(data)` must be between 3 and 8, not 2. my_fun <- function(x) { chk_flag(x) x } my_fun(TRUE) #> [1] TRUE my_fun(NA) #> Error in `my_fun()`: #> ! `x` must be a flag (TRUE or FALSE)."},{"path":"/index.html","id":"information","dir":"","previous_headings":"","what":"Information","title":"Check User-Supplied Function Arguments","text":"information see Get Started vignette.","code":""},{"path":"/index.html","id":"inspiration","dir":"","previous_headings":"","what":"Inspiration","title":"Check User-Supplied Function Arguments","text":"datacheckr checkr err testthat","code":""},{"path":"/index.html","id":"contribution","dir":"","previous_headings":"","what":"Contribution","title":"Check User-Supplied Function Arguments","text":"Please report issues. Pull requests always welcome.","code":""},{"path":"/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Check User-Supplied Function Arguments","text":"Please note chk project released Contributor Code Conduct. contributing project, agree abide terms","code":""},{"path":"/pull-request.html","id":"description","dir":"","previous_headings":"","what":"Description","title":"NA","text":"Describe changes detail","code":""},{"path":"/pull-request.html","id":"related-issue","dir":"","previous_headings":"","what":"Related Issue","title":"NA","text":"pull request closes issue please include example “fix #4” just relates issue simply include example “#4”.","code":""},{"path":"/reference/aaa.html","id":null,"dir":"Reference","previous_headings":"","what":"Workaround: Avoid backtraces in examples — aaa","title":"Workaround: Avoid backtraces in examples — aaa","text":"example run first set option process builds example. (default, pkgdown builds separate process.) also produces help page linked anywhere.","code":""},{"path":"/reference/aaa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Workaround: Avoid backtraces in examples — aaa","text":"","code":"options(rlang_backtrace_on_error = \"none\")"},{"path":"/reference/abort_chk.html","id":null,"dir":"Reference","previous_headings":"","what":"Abort Check — abort_chk","title":"Abort Check — abort_chk","text":"wrapper err() sets subclass 'chk_error'.","code":""},{"path":"/reference/abort_chk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Abort Check — abort_chk","text":"","code":"abort_chk(..., n = NULL, tidy = TRUE, call = rlang::caller_call(2))"},{"path":"/reference/abort_chk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Abort Check — abort_chk","text":"... Multiple objects converted string using paste0(..., collapse = ''). n value n converting sprintf-like types. tidy flag specifying whether capitalize first character add missing period. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"/reference/abort_chk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Abort Check — abort_chk","text":"Throws error class 'chk_error'.","code":""},{"path":"/reference/abort_chk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Abort Check — abort_chk","text":"exported allow users easily construct chk_ functions.","code":""},{"path":[]},{"path":"/reference/abort_chk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Abort Check — abort_chk","text":"","code":"try(abort_chk(\"x must be NULL\")) #> Error in eval(expr, envir, enclos) : X must be NULL. try(abort_chk(\"`x` must be NULL\")) #> Error in eval(expr, envir, enclos) : `x` must be NULL. try(abort_chk(\"there %r %n problem value%s\", n = 1)) #> Error in eval(expr, envir, enclos) : There is 1 problem value. try(abort_chk(\"there %r %n problem value%s\", n = 1.5)) #> Error in eval(expr, envir, enclos) : There are 1.5 problem values."},{"path":"/reference/cc.html","id":null,"dir":"Reference","previous_headings":"","what":"Concatenate with Commas — cc","title":"Concatenate with Commas — cc","text":"Concatenates object values string value separated comma last value separated conjunction.","code":""},{"path":"/reference/cc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concatenate with Commas — cc","text":"","code":"cc( x, conj = \", \", sep = \", \", brac = if (is.character(x) || is.factor(x)) \"'\" else \"\", ellipsis = 10L, chk = TRUE )"},{"path":"/reference/cc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concatenate with Commas — cc","text":"x object concatenate. conj string conjunction separate last value . sep string separator. brac string brac values . ellipsis numeric scalar maximum number values display using ellipsis. chk flag specifying whether check parameters.","code":""},{"path":"/reference/cc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concatenate with Commas — cc","text":"string.","code":""},{"path":"/reference/cc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Concatenate with Commas — cc","text":"default, x 10 values ellipsis used ensure 10 values displayed (including ellipsis).","code":""},{"path":"/reference/cc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Concatenate with Commas — cc","text":"","code":"cc(1:2) #> [1] \"1, 2\" cc(1:2, conj = \" or\") #> [1] \"1 or2\" cc(3:1, brac = \"'\") #> [1] \"'3', '2', '1'\" cc(1:11) #> [1] \"1, 2, 3, 4, 5, 6, 7, 8, ..., 11\" cc(as.character(1:2)) #> [1] \"'1', '2'\""},{"path":"/reference/check_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Data — check_data","title":"Check Data — check_data","text":"Checks column names, values, number rows key data.frame.","code":""},{"path":"/reference/check_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Data — check_data","text":"","code":"check_data( x, values = NULL, exclusive = FALSE, order = FALSE, nrow = numeric(0), key = character(0), x_name = NULL )"},{"path":"/reference/check_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Data — check_data","text":"x object check. values uniquely named list atomic vectors column values. exclusive flag specifying whether x must include columns named values. order flag specifying whether order columns x must match names values. nrow flag whole numeric vector value, value range possible values. key character vector columns represent unique key. x_name string name object x NULL.","code":""},{"path":"/reference/check_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Data — check_data","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Data — check_data","text":"","code":"check_data(data.frame()) check_data(data.frame(x = 2), list(x = 1)) try(check_data(data.frame(x = 2), list(y = 1L))) #> Error in check_data(data.frame(x = 2), list(y = 1L)) : #> `names(data.frame(x = 2))` must include 'y'. try(check_data(data.frame(x = 2), list(y = 1))) #> Error in check_data(data.frame(x = 2), list(y = 1)) : #> `names(data.frame(x = 2))` must include 'y'. try(check_data(data.frame(x = 2), nrow = 2)) #> Error in check_dim(x, dim = base::nrow, values = nrow, x_name = x_name, : #> `nrow(`data.frame(x = 2)`)` must be equal to 2. #> Use `rlang::last_error()$y` to show the object compared to."},{"path":"/reference/check_dim.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Dimension — check_dim","title":"Check Dimension — check_dim","text":"Checks dimension object.","code":""},{"path":"/reference/check_dim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Dimension — check_dim","text":"","code":"check_dim(x, dim = length, values = numeric(0), x_name = NULL, dim_name = NULL)"},{"path":"/reference/check_dim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Dimension — check_dim","text":"x object check. dim function returning non-negative whole number dimension. values flag whole numeric vector value, value range possible values. x_name string name object x NULL. dim_name string name dim function.","code":""},{"path":"/reference/check_dim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Dimension — check_dim","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_dim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Dimension — check_dim","text":"","code":"check_dim(1) try(check_dim(1, values = FALSE)) #> Error in check_dim(1, values = FALSE) : `length(1)` must be equal to 0L. #> Use `rlang::last_error()$y` to show the object compared to. try(check_dim(1, values = c(10, 2))) #> Error in check_dim(1, values = c(10, 2)) : #> `length(1)` must be between 2 and 10, not 1. try(check_dim(data.frame(x = 1), dim = nrow, values = c(10, 10, 2))) #> Error in check_dim(data.frame(x = 1), dim = nrow, values = c(10, 10, 2)) : #> `nrow(data.frame(x = 1))` must match 2 or 10, not 1."},{"path":"/reference/check_dirs.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Directories Exist — check_dirs","title":"Check Directories Exist — check_dirs","text":"Checks directories exist (exists = FALSE exist directories files).","code":""},{"path":"/reference/check_dirs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Directories Exist — check_dirs","text":"","code":"check_dirs(x, exists = TRUE, x_name = NULL)"},{"path":"/reference/check_dirs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Directories Exist — check_dirs","text":"x object check. exists flag specifying whether files/directories must (must ) exist. x_name string name object x NULL.","code":""},{"path":"/reference/check_dirs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Directories Exist — check_dirs","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_dirs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Directories Exist — check_dirs","text":"","code":"check_dirs(tempdir()) try(check_dirs(tempdir(), exists = FALSE)) #> Error in eval(expr, envir, enclos) : #> `tempdir()` must not specify existing directories ('/tmp/RtmpFgBJYx' exists)."},{"path":"/reference/check_files.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Files Exist — check_files","title":"Check Files Exist — check_files","text":"Checks files exist (exists = FALSE exist files directories).","code":""},{"path":"/reference/check_files.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Files Exist — check_files","text":"","code":"check_files(x, exists = TRUE, x_name = NULL)"},{"path":"/reference/check_files.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Files Exist — check_files","text":"x object check. exists flag specifying whether files/directories must (must ) exist. x_name string name object x NULL.","code":""},{"path":"/reference/check_files.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Files Exist — check_files","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_files.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Files Exist — check_files","text":"","code":"check_files(tempfile(\"unlikely-that-exists-chk\"), exists = FALSE) try(check_files(tempfile(\"unlikely-that-exists-chk\"))) #> Error in eval(expr, envir, enclos) : #> `tempfile(\"unlikely-that-exists-chk\")` must specify existing files ('/tmp/RtmpFgBJYx/unlikely-that-exists-chk181b1fb9e6b1' can't be found)."},{"path":"/reference/check_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Key — check_key","title":"Check Key — check_key","text":"Checks columns unique rows.","code":""},{"path":"/reference/check_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Key — check_key","text":"","code":"check_key(x, key = character(0), na_distinct = FALSE, x_name = NULL)"},{"path":"/reference/check_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Key — check_key","text":"x object check. key character vector columns represent unique key. na_distinct flag specifying whether missing values considered distinct. x_name string name object x NULL.","code":""},{"path":"/reference/check_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Key — check_key","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Key — check_key","text":"","code":"x <- data.frame(x = c(1, 2), y = c(1, 1)) check_key(x) try(check_key(x, \"y\")) #> Error in eval(expr, envir, enclos) : #> Column 'y' in `x` must be a unique key."},{"path":"/reference/check_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Names — check_names","title":"Check Names — check_names","text":"Checks names object.","code":""},{"path":"/reference/check_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Names — check_names","text":"","code":"check_names( x, names = character(0), exclusive = FALSE, order = FALSE, x_name = NULL )"},{"path":"/reference/check_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Names — check_names","text":"x object check. names character vector required names. exclusive flag specifying whether x must contain required names. order flag specifying whether order required names x must match order names. x_name string name object x NULL.","code":""},{"path":"/reference/check_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Names — check_names","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Names — check_names","text":"","code":"x <- c(x = 1, y = 2) check_names(x, c(\"y\", \"x\")) try(check_names(x, c(\"y\", \"x\"), order = TRUE)) #> Error in eval(expr, envir, enclos) : #> `names(x)` must include 'y' and 'x' in that order. try(check_names(x, \"x\", exclusive = TRUE)) #> Error in eval(expr, envir, enclos) : `names(x)` must not include 'y'."},{"path":"/reference/check_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Values and Class — check_values","title":"Check Values and Class — check_values","text":"Checks values S3 class atomic object.","code":""},{"path":"/reference/check_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Values and Class — check_values","text":"","code":"check_values(x, values, x_name = NULL)"},{"path":"/reference/check_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Values and Class — check_values","text":"x object check. values atomic vector specifying S3 class possible values. x_name string name object x NULL.","code":""},{"path":"/reference/check_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Values and Class — check_values","text":"informative error test fails invisible copy x.","code":""},{"path":"/reference/check_values.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Values and Class — check_values","text":"check class simply pass vector desired class. check x include missing values pass single non-missing value (correct class). allow include missing values include missing value. check includes missing values pass missing value (correct class). check range values x pass two non-missing values (well missing value required). check x includes specific values pass three non-missing values. case factor ensure values two levels check levels x ordered superset levels value three levels check identical.","code":""},{"path":[]},{"path":"/reference/check_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Values and Class — check_values","text":"","code":"check_values(1, numeric(0)) check_values(1, 2) try(check_values(1, 1L)) #> Error in check_values(1, 1L) : `1` must inherit from S3 class 'integer'. try(check_values(NA_real_, 1)) #> Error in check_values(NA_real_, 1) : #> `NA_real_` must not have any missing values."},{"path":"/reference/chk-package.html","id":null,"dir":"Reference","previous_headings":"","what":"chk: Check User-Supplied Function Arguments — chk-package","title":"chk: Check User-Supplied Function Arguments — chk-package","text":"developers check user-supplied function arguments. designed simple, fast customizable. Error messages follow tidyverse style guide.","code":""},{"path":[]},{"path":"/reference/chk-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"chk: Check User-Supplied Function Arguments — chk-package","text":"Maintainer: Joe Thorley joe@poissonconsulting.ca (ORCID) Authors: Kirill Müller (ORCID) Ayla Pearson (ORCID) contributors: Nadine Hussein nadine@poissonconsulting.ca (ORCID) [contributor] Evan Amies-Galonski evan@poissonconsulting.ca (ORCID) [contributor] Poisson Consulting [copyright holder, funder]","code":""},{"path":"/reference/chk_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Check All — chk_all","title":"Check All — chk_all","text":"Checks elements using (vapply(x, chk_fun, TRUE, ...))","code":""},{"path":"/reference/chk_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check All — chk_all","text":"","code":"chk_all(x, chk_fun, ..., x_name = NULL) vld_all(x, vld_fun, ...)"},{"path":"/reference/chk_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check All — chk_all","text":"x object check. chk_fun chk_ function. ... Additional arguments. x_name string name object x NULL. vld_fun vld_ function.","code":""},{"path":"/reference/chk_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check All — chk_all","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_all.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check All — chk_all","text":"vld_all(): Validate ","code":""},{"path":[]},{"path":"/reference/chk_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check All — chk_all","text":"","code":"# chk_all chk_all(TRUE, chk_lgl) # FIXME try(chk_all(1, chk_lgl)) chk_all(c(TRUE, NA), chk_lgl) # vld_all vld_all(c(TRUE, NA), vld_lgl) #> [1] TRUE"},{"path":"/reference/chk_all_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check All Equal — chk_all_equal","title":"Check All Equal — chk_all_equal","text":"Checks elements x equal using length(x) < 2L || (vapply(x, vld_equal, TRUE, y = x[[1]], tolerance = tolerance))","code":""},{"path":"/reference/chk_all_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check All Equal — chk_all_equal","text":"","code":"chk_all_equal(x, tolerance = sqrt(.Machine$double.eps), x_name = NULL) vld_all_equal(x, tolerance = sqrt(.Machine$double.eps))"},{"path":"/reference/chk_all_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check All Equal — chk_all_equal","text":"x object check. tolerance non-negative numeric scalar. x_name string name object x NULL.","code":""},{"path":"/reference/chk_all_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check All Equal — chk_all_equal","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_all_equal.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check All Equal — chk_all_equal","text":"vld_all_equal(): Validate Equal","code":""},{"path":[]},{"path":"/reference/chk_all_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check All Equal — chk_all_equal","text":"","code":"# chk_all_equal chk_all_equal(c(1, 1.00000001)) try(chk_all_equal(c(1, 1.0000001))) #> Error in eval(expr, envir, enclos) : #> `c(1, 1.0000001)` must have equal elements. chk_all_equal(list(c(x = 1), c(x = 1))) try(chk_all_equal(list(c(x = 1), c(y = 1)))) #> Error in eval(expr, envir, enclos) : #> `list(c(x = 1), c(y = 1))` must have equal elements. # vld_all_equal vld_all_equal(c(1, 1L)) #> [1] TRUE"},{"path":"/reference/chk_all_equivalent.html","id":null,"dir":"Reference","previous_headings":"","what":"Check All Equivalent — chk_all_equivalent","title":"Check All Equivalent — chk_all_equivalent","text":"Checks elements x equivalent using length(x) < 2L || (vapply(x, vld_equivalent, TRUE, y = x[[1]], tolerance = tolerance))","code":""},{"path":"/reference/chk_all_equivalent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check All Equivalent — chk_all_equivalent","text":"","code":"chk_all_equivalent(x, tolerance = sqrt(.Machine$double.eps), x_name = NULL) vld_all_equivalent(x, tolerance = sqrt(.Machine$double.eps))"},{"path":"/reference/chk_all_equivalent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check All Equivalent — chk_all_equivalent","text":"x object check. tolerance non-negative numeric scalar. x_name string name object x NULL.","code":""},{"path":"/reference/chk_all_equivalent.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check All Equivalent — chk_all_equivalent","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_all_equivalent.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check All Equivalent — chk_all_equivalent","text":"vld_all_equivalent(): Validate Equivalent","code":""},{"path":[]},{"path":"/reference/chk_all_equivalent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check All Equivalent — chk_all_equivalent","text":"","code":"# chk_all_equivalent chk_all_equivalent(c(1, 1.00000001)) try(chk_all_equivalent(c(1, 1.0000001))) #> Error in eval(expr, envir, enclos) : #> `c(1, 1.0000001)` must have equivalent elements. chk_all_equivalent(list(c(x = 1), c(x = 1))) chk_all_equivalent(list(c(x = 1), c(y = 1))) # vld_all_equivalent vld_all_equivalent(c(x = 1, y = 1)) #> [1] TRUE"},{"path":"/reference/chk_all_identical.html","id":null,"dir":"Reference","previous_headings":"","what":"Check All Identical — chk_all_identical","title":"Check All Identical — chk_all_identical","text":"Checks elements x identical using length(x) < 2L || (vapply(x, vld_identical, TRUE, y = x[[1]])) Pass: c(1, 1, 1), list(1, 1) Fail: c(1, 1.0000001), list(1, NA)","code":""},{"path":"/reference/chk_all_identical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check All Identical — chk_all_identical","text":"","code":"chk_all_identical(x, x_name = NULL) vld_all_identical(x)"},{"path":"/reference/chk_all_identical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check All Identical — chk_all_identical","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_all_identical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check All Identical — chk_all_identical","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_all_identical.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check All Identical — chk_all_identical","text":"vld_all_identical(): Validate Identical","code":""},{"path":[]},{"path":"/reference/chk_all_identical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check All Identical — chk_all_identical","text":"","code":"# chk_all_identical chk_all_identical(c(1, 1)) try(chk_all_identical(c(1, 1.1))) #> Error in eval(expr, envir, enclos) : #> `c(1, 1.1)` must have identical elements. # vld_all_identical vld_all_identical(c(1, 1)) #> [1] TRUE"},{"path":"/reference/chk_array.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Array — chk_array","title":"Check Array — chk_array","text":"Checks array using .array(x)","code":""},{"path":"/reference/chk_array.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Array — chk_array","text":"","code":"chk_array(x, x_name = NULL) vld_array(x)"},{"path":"/reference/chk_array.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Array — chk_array","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_array.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Array — chk_array","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_array.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Array — chk_array","text":"vld_array(): Validate Array","code":""},{"path":[]},{"path":"/reference/chk_array.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Array — chk_array","text":"","code":"# chk_array chk_array(array(1)) try(chk_array(matrix(1))) # vld_array vld_array(1) #> [1] FALSE vld_array(array(1)) #> [1] TRUE"},{"path":"/reference/chk_atomic.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Atomic — chk_atomic","title":"Check Atomic — chk_atomic","text":"Checks atomic using .atomic(x)","code":""},{"path":"/reference/chk_atomic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Atomic — chk_atomic","text":"","code":"chk_atomic(x, x_name = NULL) vld_atomic(x)"},{"path":"/reference/chk_atomic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Atomic — chk_atomic","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_atomic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Atomic — chk_atomic","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_atomic.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Atomic — chk_atomic","text":"vld_atomic(): Validate Atomic","code":""},{"path":[]},{"path":"/reference/chk_atomic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Atomic — chk_atomic","text":"","code":"# chk_atomic chk_atomic(1) try(chk_atomic(list(1))) #> Error in eval(expr, envir, enclos) : `list(1)` must be atomic. # vld_atomic vld_atomic(1) #> [1] TRUE vld_atomic(matrix(1:3)) #> [1] TRUE vld_atomic(character(0)) #> [1] TRUE vld_atomic(list(1)) #> [1] FALSE vld_atomic(NULL) #> [1] TRUE"},{"path":"/reference/chk_character.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Character — chk_character","title":"Check Character — chk_character","text":"Checks character using .character(x)","code":""},{"path":"/reference/chk_character.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Character — chk_character","text":"","code":"chk_character(x, x_name = NULL) vld_character(x)"},{"path":"/reference/chk_character.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Character — chk_character","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_character.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Character — chk_character","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_character.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Character — chk_character","text":"vld_character(): Validate Character","code":""},{"path":[]},{"path":"/reference/chk_character.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Character — chk_character","text":"","code":"# chk_character chk_character(\"1\") try(chk_character(1)) #> Error in eval(expr, envir, enclos) : `1` must be character. # vld_character vld_character(\"1\") #> [1] TRUE vld_character(matrix(\"a\")) #> [1] TRUE vld_character(character(0)) #> [1] TRUE vld_character(NA_character_) #> [1] TRUE vld_character(1) #> [1] FALSE vld_character(TRUE) #> [1] FALSE vld_character(factor(\"text\")) #> [1] FALSE"},{"path":"/reference/chk_character_or_factor.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Character or Factor — chk_character_or_factor","title":"Check Character or Factor — chk_character_or_factor","text":"Checks character factor using .character(x) || .factor(x)","code":""},{"path":"/reference/chk_character_or_factor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Character or Factor — chk_character_or_factor","text":"","code":"chk_character_or_factor(x, x_name = NULL) vld_character_or_factor(x)"},{"path":"/reference/chk_character_or_factor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Character or Factor — chk_character_or_factor","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_character_or_factor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Character or Factor — chk_character_or_factor","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_character_or_factor.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Character or Factor — chk_character_or_factor","text":"vld_character_or_factor(): Validate Character Factor","code":""},{"path":[]},{"path":"/reference/chk_character_or_factor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Character or Factor — chk_character_or_factor","text":"","code":"# chk_character_or_factor chk_character_or_factor(\"1\") chk_character_or_factor(factor(\"1\")) try(chk_character(1)) #> Error in eval(expr, envir, enclos) : `1` must be character. # vld_character_or_factor vld_character_or_factor(\"1\") #> [1] TRUE vld_character_or_factor(matrix(\"a\")) #> [1] TRUE vld_character_or_factor(character(0)) #> [1] TRUE vld_character_or_factor(NA_character_) #> [1] TRUE vld_character_or_factor(1) #> [1] FALSE vld_character_or_factor(TRUE) #> [1] FALSE vld_character_or_factor(factor(\"text\")) #> [1] TRUE"},{"path":"/reference/chk_chr.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Character Scalar — chk_chr","title":"Check Character Scalar — chk_chr","text":"Checks character scalar using .character(x) && length(x) == 1L","code":""},{"path":"/reference/chk_chr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Character Scalar — chk_chr","text":"","code":"chk_chr(x, x_name = NULL) vld_chr(x)"},{"path":"/reference/chk_chr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Character Scalar — chk_chr","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_chr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Character Scalar — chk_chr","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_chr.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Character Scalar — chk_chr","text":"vld_chr(): Validate Character Scalar","code":""},{"path":[]},{"path":"/reference/chk_chr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Character Scalar — chk_chr","text":"","code":"chk_chr(\"a\") try(chk_chr(1)) #> Warning: `chk_chr()` was deprecated in chk 0.6.1. #> ℹ Please use `chk::chk_scalar(x);` `chk::chk_character(x)` instead #> Error in eval(expr, envir, enclos) : `1` must be a character scalar. # vld_chr vld_chr(\"\") #> [1] TRUE vld_chr(\"a\") #> [1] TRUE vld_chr(NA_character_) #> [1] TRUE vld_chr(c(\"a\", \"b\")) #> [1] FALSE vld_chr(1) #> [1] FALSE"},{"path":"/reference/chk_compatible_lengths.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Compatible Lengths — chk_compatible_lengths","title":"Check Compatible Lengths — chk_compatible_lengths","text":"Checks objects (including vectors) lengths 'strictly recycled'. say must either zero length length length 1.","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Compatible Lengths — chk_compatible_lengths","text":"","code":"chk_compatible_lengths(..., x_name = NULL) vld_compatible_lengths(...)"},{"path":"/reference/chk_compatible_lengths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Compatible Lengths — chk_compatible_lengths","text":"... objects check compatible lengths. x_name string name object x NULL.","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Compatible Lengths — chk_compatible_lengths","text":"chk_ function throws informative error test fails.","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Compatible Lengths — chk_compatible_lengths","text":"function helps check vectors 'strictly recycled.' example function error vector length 2 length 4, even though vector length 2 'loosely recycled' match vector length 4 combined. intent function check strict recycling occurring.","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Compatible Lengths — chk_compatible_lengths","text":"vld_compatible_lengths(): Validate Compatible Lengths","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Compatible Lengths — chk_compatible_lengths","text":"","code":"# chk_compatible_lengths a <- integer(0) b <- numeric(0) chk_compatible_lengths(a, b) a <- 1 b <- 2 chk_compatible_lengths(a, b) a <- 1:3 b <- 1:3 chk_compatible_lengths(a, b) b <- 1 chk_compatible_lengths(a, b) b <- 1:2 try(chk_compatible_lengths(a, b)) #> Error in eval(expr, envir, enclos) : #> ... objects must be all zero length or the same length with some of length of 1 but not lengths 2 and 3. b <- 1:6 try(chk_compatible_lengths(a, b)) #> Error in eval(expr, envir, enclos) : #> ... objects must be all zero length or the same length with some of length of 1 but not lengths 3 and 6. # vld_compatible_lengths a <- integer(0) b <- numeric(0) vld_compatible_lengths(a, b) #> [1] TRUE a <- 1 b <- 2 vld_compatible_lengths(a, b) #> [1] TRUE a <- 1:3 b <- 1:3 vld_compatible_lengths(a, b) #> [1] TRUE b <- 1 vld_compatible_lengths(a, b) #> [1] TRUE b <- 1:2 vld_compatible_lengths(a, b) #> [1] FALSE b <- 1:6 vld_compatible_lengths(a, b) #> [1] FALSE"},{"path":"/reference/chk_count.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Count — chk_count","title":"Check Count — chk_count","text":"Checks non-negative whole number using vld_whole_number(x) && x >= 0","code":""},{"path":"/reference/chk_count.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Count — chk_count","text":"","code":"chk_count(x, x_name = NULL) vld_count(x)"},{"path":"/reference/chk_count.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Count — chk_count","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_count.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Count — chk_count","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_count.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Count — chk_count","text":"vld_count(): Validate Count","code":""},{"path":[]},{"path":"/reference/chk_count.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Count — chk_count","text":"","code":"# chk_count chk_count(1) try(chk_count(1.5)) #> Error in eval(expr, envir, enclos) : #> `1.5` must be a count (non-negative non-missing integer scalar or double equivalent). # vld_count vld_count(1) #> [1] TRUE vld_count(0L) #> [1] TRUE vld_count(-1) #> [1] FALSE vld_count(0.5) #> [1] FALSE"},{"path":"/reference/chk_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Data — chk_data","title":"Check Data — chk_data","text":"Checks data.frame using inherits(x, \"data.frame\")","code":""},{"path":"/reference/chk_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Data — chk_data","text":"","code":"chk_data(x, x_name = NULL) vld_data(x)"},{"path":"/reference/chk_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Data — chk_data","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Data — chk_data","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_data.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Data — chk_data","text":"vld_data(): Validate Data","code":""},{"path":[]},{"path":"/reference/chk_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Data — chk_data","text":"","code":"# chk_data chk_data(data.frame(x = 1)) try(chk_data(1)) #> Error in eval(expr, envir, enclos) : `1` must be a data.frame. # vld_data vld_data(data.frame()) #> [1] TRUE vld_data(data.frame(x = 1)) #> [1] TRUE vld_data(c(x = 1)) #> [1] FALSE"},{"path":"/reference/chk_date.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Date — chk_date","title":"Check Date — chk_date","text":"Checks non-missing Date scalar using inherits(x, \"Date\") && length(x) == 1L && !anyNA(x)","code":""},{"path":"/reference/chk_date.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Date — chk_date","text":"","code":"chk_date(x, x_name = NULL) vld_date(x)"},{"path":"/reference/chk_date.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Date — chk_date","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_date.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Date — chk_date","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_date.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Date — chk_date","text":"vld_date(): Validate Date","code":""},{"path":[]},{"path":"/reference/chk_date.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Date — chk_date","text":"","code":"# chk_date chk_date(Sys.Date()) try(chk_date(1)) #> Error in eval(expr, envir, enclos) : #> `1` must be a date (non-missing Date scalar). # vld_date vld_date(Sys.Date()) #> [1] TRUE vld_date(Sys.time()) #> [1] FALSE vld_date(1) #> [1] FALSE"},{"path":"/reference/chk_date_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Date Time — chk_date_time","title":"Check Date Time — chk_date_time","text":"Checks non-missing POSIXct scalar using inherits(x, \"POSIXct\") && length(x) == 1L && !anyNA(x)","code":""},{"path":"/reference/chk_date_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Date Time — chk_date_time","text":"","code":"chk_date_time(x, x_name = NULL) chk_datetime(x, x_name = NULL) vld_date_time(x) vld_datetime(x)"},{"path":"/reference/chk_date_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Date Time — chk_date_time","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_date_time.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Date Time — chk_date_time","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_date_time.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Date Time — chk_date_time","text":"chk_datetime(): Check Date Time (Deprecated) vld_date_time(): Validate Date Time vld_datetime(): Validate Date Time (Deprecated)","code":""},{"path":[]},{"path":"/reference/chk_date_time.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Date Time — chk_date_time","text":"","code":"# chk_date_time chk_date_time(as.POSIXct(\"2001-01-02\")) try(chk_date_time(1)) #> Error in eval(expr, envir, enclos) : #> `1` must be a date time (non-missing POSIXct scalar). # vld_date_time vld_date_time(as.POSIXct(\"2001-01-02\")) #> [1] TRUE vld_date_time(Sys.time()) #> [1] TRUE vld_date_time(1) #> [1] FALSE vld_date_time(\"2001-01-02\") #> [1] FALSE vld_date_time(c(Sys.time(), Sys.time())) #> [1] FALSE"},{"path":"/reference/chk_dbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Double Scalar — chk_dbl","title":"Check Double Scalar — chk_dbl","text":"Checks double scalar using .double(x) && length(x) == 1L","code":""},{"path":"/reference/chk_dbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Double Scalar — chk_dbl","text":"","code":"chk_dbl(x, x_name = NULL) vld_dbl(x)"},{"path":"/reference/chk_dbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Double Scalar — chk_dbl","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_dbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Double Scalar — chk_dbl","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_dbl.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Double Scalar — chk_dbl","text":"vld_dbl(): Validate Double","code":""},{"path":[]},{"path":"/reference/chk_dbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Double Scalar — chk_dbl","text":"","code":"# chk_dbl chk_dbl(1) try(chk_dbl(1L)) #> Warning: `chk_dbl()` was deprecated in chk 0.6.1. #> ℹ Please use `chk::chk_scalar(x);` `chk::chk_double(x)` instead #> Error in eval(expr, envir, enclos) : `1L` must be double (real) scalar. # vld_dbl vld_dbl(1) #> [1] TRUE vld_dbl(double(0)) #> [1] FALSE vld_dbl(NA_real_) #> [1] TRUE vld_dbl(c(1, 1)) #> [1] FALSE vld_dbl(1L) #> [1] FALSE"},{"path":"/reference/chk_deprecated.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecated functions — chk_deprecated","title":"Deprecated functions — chk_deprecated","text":"Deprecated chk_() functions.","code":""},{"path":"/reference/chk_deprecated.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecated functions — chk_deprecated","text":"","code":"chk_dirs(x) chk_files(x) chk_has(x, values, x_name = NULL) chk_in(x, values, x_name = NULL) chk_no_missing(x, x_name = NULL) vld_no_missing(x) chk_off() chk_on() is_chk_on() chk_proportion(x, x_name = NULL) deparse_backtick(x)"},{"path":"/reference/chk_deprecated.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecated functions — chk_deprecated","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_deprecated.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Deprecated functions — chk_deprecated","text":"chk_dirs(): Check Directories Exist Replace [chk_all](x, [chk_dir]) chk_files(): Check Files Exist Replace [chk_all](x, [chk_file]) chk_has(): Check Replace chk_superset() chk_in(): Check Replace chk_subset() chk_no_missing(): Check Missing Values Replace chk_not_any_na() vld_no_missing(): Validate Missing Values Replace vld_not_any_na() chk_off(): Turns checking approach longer recommended chk_on(): Turns checking approach longer recommended is_chk_on(): Tests checking approach longer recommended chk_proportion(): Check Proportion Replace [chk_number](x); [chk_range](x) deparse_backtick(): Deparse Backtick Replace deparse_backtick_chk()","code":""},{"path":[]},{"path":"/reference/chk_dir.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Directory Exists — chk_dir","title":"Check Directory Exists — chk_dir","text":"Checks directory exists using vld_string(x) && dir.exists(x)","code":""},{"path":"/reference/chk_dir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Directory Exists — chk_dir","text":"","code":"chk_dir(x, x_name = NULL) vld_dir(x)"},{"path":"/reference/chk_dir.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Directory Exists — chk_dir","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_dir.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Directory Exists — chk_dir","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_dir.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Directory Exists — chk_dir","text":"vld_dir(): Validate Directory Exists","code":""},{"path":[]},{"path":"/reference/chk_dir.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Directory Exists — chk_dir","text":"","code":"# chk_dir chk_dir(tempdir()) try(chk_dir(tempfile())) #> Error in eval(expr, envir, enclos) : #> `tempfile()` must specify an existing directory ('/tmp/RtmpFgBJYx/file181bfe9a9d7' can't be found). # vld_dir vld_dir(1) #> [1] FALSE vld_dir(tempdir()) #> [1] TRUE vld_dir(tempfile()) #> [1] FALSE"},{"path":"/reference/chk_double.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Double — chk_double","title":"Check Double — chk_double","text":"Checks double using .double(x)","code":""},{"path":"/reference/chk_double.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Double — chk_double","text":"","code":"chk_double(x, x_name = NULL) vld_double(x)"},{"path":"/reference/chk_double.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Double — chk_double","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_double.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Double — chk_double","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_double.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Double — chk_double","text":"vld_double(): Validate Double","code":""},{"path":[]},{"path":"/reference/chk_double.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Double — chk_double","text":"","code":"# chk_double chk_double(1) try(chk_double(1L)) #> Error in eval(expr, envir, enclos) : `1L` must be double. # vld_double vld_double(1) #> [1] TRUE vld_double(matrix(c(1, 2, 3, 4), nrow = 2L)) #> [1] TRUE vld_double(double(0)) #> [1] TRUE vld_double(numeric(0)) #> [1] TRUE vld_double(NA_real_) #> [1] TRUE vld_double(1L) #> [1] FALSE vld_double(TRUE) #> [1] FALSE"},{"path":"/reference/chk_environment.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Environment — chk_environment","title":"Check Environment — chk_environment","text":"Checks environment using .environment(x)","code":""},{"path":"/reference/chk_environment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Environment — chk_environment","text":"","code":"chk_environment(x, x_name = NULL) vld_environment(x)"},{"path":"/reference/chk_environment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Environment — chk_environment","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_environment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Environment — chk_environment","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_environment.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Environment — chk_environment","text":"vld_environment(): Validate Environment","code":""},{"path":[]},{"path":"/reference/chk_environment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Environment — chk_environment","text":"","code":"# chk_environment chk_environment(.GlobalEnv) try(chk_environment(1)) #> Error in eval(expr, envir, enclos) : `1` must be an environment. # vld_environment vld_environment(1) #> [1] FALSE vld_environment(list(1)) #> [1] FALSE vld_environment(.GlobalEnv) #> [1] TRUE vld_environment(environment()) #> [1] TRUE"},{"path":"/reference/chk_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Equal — chk_equal","title":"Check Equal — chk_equal","text":"Checks equal (identical within tolerance) y using vld_true(.equal(x, y, tolerance))","code":""},{"path":"/reference/chk_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Equal — chk_equal","text":"","code":"chk_equal(x, y, tolerance = sqrt(.Machine$double.eps), x_name = NULL) vld_equal(x, y, tolerance = sqrt(.Machine$double.eps))"},{"path":"/reference/chk_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Equal — chk_equal","text":"x object check. y object check . tolerance non-negative numeric scalar. x_name string name object x NULL.","code":""},{"path":"/reference/chk_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Equal — chk_equal","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_equal.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Equal — chk_equal","text":"vld_equal(): Validate Equal","code":""},{"path":[]},{"path":"/reference/chk_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Equal — chk_equal","text":"","code":"# chk_equal chk_equal(1, 1.00000001) try(chk_equal(1, 1.0000001)) #> Error in eval(expr, envir, enclos) : `1` must be equal to 1.0000001. #> Use `rlang::last_error()$y` to show the object compared to. chk_equal(1, 1L) chk_equal(c(x = 1), c(x = 1L)) try(chk_equal(c(x = 1), c(y = 1L))) #> Error in eval(expr, envir, enclos) : #> `c(x = 1)` must be equal to c(y = 1L). #> Use `rlang::last_error()$y` to show the object compared to. vld_equal(1, 1.00000001) #> [1] TRUE"},{"path":"/reference/chk_equivalent.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Equivalent — chk_equivalent","title":"Check Equivalent — chk_equivalent","text":"Checks equivalent (equal ignoring attributes) y using vld_true(.equal(x, y, tolerance, check.attributes = FALSE))","code":""},{"path":"/reference/chk_equivalent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Equivalent — chk_equivalent","text":"","code":"chk_equivalent(x, y, tolerance = sqrt(.Machine$double.eps), x_name = NULL) vld_equivalent(x, y, tolerance = sqrt(.Machine$double.eps))"},{"path":"/reference/chk_equivalent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Equivalent — chk_equivalent","text":"x object check. y object check . tolerance non-negative numeric scalar. x_name string name object x NULL.","code":""},{"path":"/reference/chk_equivalent.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Equivalent — chk_equivalent","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_equivalent.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Equivalent — chk_equivalent","text":"vld_equivalent(): Validate Equivalent","code":""},{"path":[]},{"path":"/reference/chk_equivalent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Equivalent — chk_equivalent","text":"","code":"# chk_equivalent chk_equivalent(1, 1.00000001) try(chk_equivalent(1, 1.0000001)) #> Error in eval(expr, envir, enclos) : `1` must be equivalent to 1.0000001. #> Use `rlang::last_error()$y` to show the object compared to. chk_equivalent(1, 1L) chk_equivalent(c(x = 1), c(y = 1)) vld_equivalent(c(x = 1), c(y = 1L)) #> [1] TRUE"},{"path":"/reference/chk_ext.html","id":null,"dir":"Reference","previous_headings":"","what":"Check File Extension — chk_ext","title":"Check File Extension — chk_ext","text":"Checks extension using vld_string(x) && vld_subset(tools::file_ext(x), ext) user may want use toupper() tolower() ensure case matches.","code":""},{"path":"/reference/chk_ext.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check File Extension — chk_ext","text":"","code":"chk_ext(x, ext, x_name = NULL) vld_ext(x, ext)"},{"path":"/reference/chk_ext.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check File Extension — chk_ext","text":"x object check. ext character vector permitted file extensions (without .). x_name string name object x NULL.","code":""},{"path":"/reference/chk_ext.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check File Extension — chk_ext","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_ext.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check File Extension — chk_ext","text":"vld_ext(): Validate File Extension","code":""},{"path":[]},{"path":"/reference/chk_ext.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check File Extension — chk_ext","text":"","code":"# chk_ext try(chk_ext(\"file1.pdf\", \"png\")) #> Error in eval(expr, envir, enclos) : #> `\"file1.pdf\"` must have extension 'png' (not 'pdf'). # vld_ext vld_ext(\"oeu.pdf\", \"pdf\") #> [1] TRUE vld_ext(toupper(\"oeu.pdf\"), \"PDF\") #> [1] TRUE"},{"path":"/reference/chk_factor.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Factor — chk_factor","title":"Check Factor — chk_factor","text":"Checks factor using .factor(x)","code":""},{"path":"/reference/chk_factor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Factor — chk_factor","text":"","code":"chk_factor(x, x_name = NULL) vld_factor(x)"},{"path":"/reference/chk_factor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Factor — chk_factor","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_factor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Factor — chk_factor","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_factor.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Factor — chk_factor","text":"vld_factor(): Validate Factor","code":""},{"path":[]},{"path":"/reference/chk_factor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Factor — chk_factor","text":"","code":"# chk_factor chk_factor(factor(\"1\")) try(chk_factor(\"1\")) #> Error in eval(expr, envir, enclos) : `\"1\"` must be factor. # vld_factor vld_factor(factor(\"1\")) #> [1] TRUE vld_factor(factor(0)) #> [1] TRUE vld_factor(\"1\") #> [1] FALSE vld_factor(1L) #> [1] FALSE"},{"path":"/reference/chk_false.html","id":null,"dir":"Reference","previous_headings":"","what":"Check FALSE — chk_false","title":"Check FALSE — chk_false","text":"Check FALSE using .logical(x) && length(x) == 1L && !anyNA(x) && !x","code":""},{"path":"/reference/chk_false.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check FALSE — chk_false","text":"","code":"chk_false(x, x_name = NULL) vld_false(x)"},{"path":"/reference/chk_false.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check FALSE — chk_false","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_false.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check FALSE — chk_false","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_false.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check FALSE — chk_false","text":"vld_false(): Validate FALSE","code":""},{"path":[]},{"path":"/reference/chk_false.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check FALSE — chk_false","text":"","code":"# chk_false chk_false(FALSE) try(chk_false(0)) #> Error in eval(expr, envir, enclos) : `0` must be FALSE. # vld_false vld_false(TRUE) #> [1] FALSE vld_false(FALSE) #> [1] TRUE vld_false(NA) #> [1] FALSE vld_false(0) #> [1] FALSE vld_false(c(FALSE, FALSE)) #> [1] FALSE"},{"path":"/reference/chk_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Check File Exists — chk_file","title":"Check File Exists — chk_file","text":"Checks file exists using vld_string(x) && file.exists(x) && !dir.exists(x)","code":""},{"path":"/reference/chk_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check File Exists — chk_file","text":"","code":"chk_file(x, x_name = NULL) vld_file(x)"},{"path":"/reference/chk_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check File Exists — chk_file","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check File Exists — chk_file","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_file.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check File Exists — chk_file","text":"vld_file(): Validate File Exists","code":""},{"path":[]},{"path":"/reference/chk_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check File Exists — chk_file","text":"","code":"# chk_file try(chk_file(tempfile())) #> Error in eval(expr, envir, enclos) : #> `tempfile()` must specify an existing file ('/tmp/RtmpFgBJYx/file181b1a92e14' can't be found). # vld_file vld_file(tempfile()) #> [1] FALSE"},{"path":"/reference/chk_flag.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Flag — chk_flag","title":"Check Flag — chk_flag","text":"Checks non-missing logical scalar using .logical(x) && length(x) == 1L && !anyNA(x) Pass: TRUE, FALSE. Fail: logical(0), c(TRUE, TRUE), \"TRUE\", 1, NA.","code":""},{"path":"/reference/chk_flag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Flag — chk_flag","text":"","code":"chk_flag(x, x_name = NULL) vld_flag(x)"},{"path":"/reference/chk_flag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Flag — chk_flag","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_flag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Flag — chk_flag","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_flag.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Flag — chk_flag","text":"vld_flag(): Validate Flag","code":""},{"path":[]},{"path":"/reference/chk_flag.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Flag — chk_flag","text":"","code":"# chk_flag chk_flag(TRUE) try(vld_flag(1)) #> [1] FALSE # vld_flag vld_flag(TRUE) #> [1] TRUE vld_flag(1) #> [1] FALSE"},{"path":"/reference/chk_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Function — chk_function","title":"Check Function — chk_function","text":"Checks function using .function(x) && (.null(formals) || length(formals(x)) == formals)","code":""},{"path":"/reference/chk_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Function — chk_function","text":"","code":"chk_function(x, formals = NULL, x_name = NULL) vld_function(x, formals = NULL)"},{"path":"/reference/chk_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Function — chk_function","text":"x object check. formals count number formal arguments. x_name string name object x NULL.","code":""},{"path":"/reference/chk_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Function — chk_function","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_function.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Function — chk_function","text":"vld_function(): Validate Function","code":""},{"path":[]},{"path":"/reference/chk_function.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Function — chk_function","text":"","code":"# chk_function chk_function(mean) try(chk_function(1)) #> Error in eval(expr, envir, enclos) : `1` must be a function. # vld_function vld_function(mean) #> [1] TRUE vld_function(function(x) x) #> [1] TRUE vld_function(1) #> [1] FALSE vld_function(list(1)) #> [1] FALSE"},{"path":"/reference/chk_gt.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Greater Than — chk_gt","title":"Check Greater Than — chk_gt","text":"Checks non-missing values greater value using (x[!.na(x)] > value)","code":""},{"path":"/reference/chk_gt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Greater Than — chk_gt","text":"","code":"chk_gt(x, value = 0, x_name = NULL) vld_gt(x, value = 0)"},{"path":"/reference/chk_gt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Greater Than — chk_gt","text":"x object check. value non-missing scalar value. x_name string name object x NULL.","code":""},{"path":"/reference/chk_gt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Greater Than — chk_gt","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_gt.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Greater Than — chk_gt","text":"vld_gt(): Validate Greater ","code":""},{"path":[]},{"path":"/reference/chk_gt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Greater Than — chk_gt","text":"","code":"# chk_gt chk_gt(0.1) try(chk_gt(c(0.1, -0.2))) #> Error in eval(expr, envir, enclos) : #> `c(0.1, -0.2)` must have values greater than 0. # vld_gt vld_gt(numeric(0)) #> [1] TRUE vld_gt(0) #> [1] FALSE vld_gt(0.1) #> [1] TRUE vld_gt(c(0.1, 0.2, NA)) #> [1] TRUE vld_gt(c(0.1, -0.2)) #> [1] FALSE vld_gt(c(-0.1, 0.2), value = -1) #> [1] TRUE vld_gt(\"b\", value = \"a\") #> [1] TRUE"},{"path":"/reference/chk_gte.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Greater Than or Equal To — chk_gte","title":"Check Greater Than or Equal To — chk_gte","text":"Checks non-missing values greater equal y using (x[!.na(x)] >= value)","code":""},{"path":"/reference/chk_gte.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Greater Than or Equal To — chk_gte","text":"","code":"chk_gte(x, value = 0, x_name = NULL) vld_gte(x, value = 0)"},{"path":"/reference/chk_gte.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Greater Than or Equal To — chk_gte","text":"x object check. value non-missing scalar value. x_name string name object x NULL.","code":""},{"path":"/reference/chk_gte.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Greater Than or Equal To — chk_gte","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_gte.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Greater Than or Equal To — chk_gte","text":"vld_gte(): Validate Greater Equal ","code":""},{"path":[]},{"path":"/reference/chk_gte.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Greater Than or Equal To — chk_gte","text":"","code":"# chk_gte chk_gte(0) try(chk_gte(-0.1)) #> Error in eval(expr, envir, enclos) : #> `-0.1` must be greater than or equal to 0, not -0.1. # vld_gte vld_gte(numeric(0)) #> [1] TRUE vld_gte(0) #> [1] TRUE vld_gte(-0.1) #> [1] FALSE vld_gte(c(0.1, 0.2, NA)) #> [1] TRUE vld_gte(c(0.1, 0.2, NA), value = 1) #> [1] FALSE"},{"path":"/reference/chk_identical.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Identical — chk_identical","title":"Check Identical — chk_identical","text":"Checks identical y using identical(x, y)","code":""},{"path":"/reference/chk_identical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Identical — chk_identical","text":"","code":"chk_identical(x, y, x_name = NULL) vld_identical(x, y)"},{"path":"/reference/chk_identical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Identical — chk_identical","text":"x object check. y object check . x_name string name object x NULL.","code":""},{"path":"/reference/chk_identical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Identical — chk_identical","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_identical.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Identical — chk_identical","text":"vld_identical(): Validate Identical","code":""},{"path":[]},{"path":"/reference/chk_identical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Identical — chk_identical","text":"","code":"# chk_identical chk_identical(1, 1) try(chk_identical(1, 1L)) #> Error in eval(expr, envir, enclos) : `1` must be identical to 1L. #> Use `rlang::last_error()$y` to show the object compared to. chk_identical(c(1, 1), c(1, 1)) try(chk_identical(1, c(1, 1))) #> Error in eval(expr, envir, enclos) : #> `1` must be identical to the y object of class . #> Use `rlang::last_error()$y` to show the object compared to. vld_identical(1, 1) #> [1] TRUE"},{"path":"/reference/chk_integer.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Integer — chk_integer","title":"Check Integer — chk_integer","text":"Checks integer using .integer(x)","code":""},{"path":"/reference/chk_integer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Integer — chk_integer","text":"","code":"chk_integer(x, x_name = NULL) vld_integer(x)"},{"path":"/reference/chk_integer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Integer — chk_integer","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_integer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Integer — chk_integer","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_integer.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Integer — chk_integer","text":"vld_integer(): Validate Integer","code":""},{"path":[]},{"path":"/reference/chk_integer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Integer — chk_integer","text":"","code":"# chk_integer chk_integer(1L) try(chk_integer(1)) #> Error in eval(expr, envir, enclos) : `1` must be integer. # vld_integer vld_integer(1L) #> [1] TRUE vld_integer(matrix(1:4, nrow = 2L)) #> [1] TRUE vld_integer(integer(0)) #> [1] TRUE vld_integer(NA_integer_) #> [1] TRUE vld_integer(1) #> [1] FALSE vld_integer(TRUE) #> [1] FALSE"},{"path":"/reference/chk_is.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Class — chk_is","title":"Check Class — chk_is","text":"Checks inherits class using inherits(x, class)","code":""},{"path":"/reference/chk_is.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Class — chk_is","text":"","code":"chk_is(x, class, x_name = NULL) vld_is(x, class)"},{"path":"/reference/chk_is.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Class — chk_is","text":"x object check. class string specifying class. x_name string name object x NULL.","code":""},{"path":"/reference/chk_is.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Class — chk_is","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_is.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Class — chk_is","text":"vld_is(): Validate Inherits Class","code":""},{"path":[]},{"path":"/reference/chk_is.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Class — chk_is","text":"","code":"chk_is(1, \"numeric\") try(chk_is(1L, \"double\")) #> Error in eval(expr, envir, enclos) : #> `1L` must inherit from class 'double'. # vld_is vld_is(numeric(0), \"numeric\") #> [1] TRUE vld_is(1L, \"double\") #> [1] FALSE"},{"path":"/reference/chk_join.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Join — chk_join","title":"Check Join — chk_join","text":"Checks rows x match least one y.","code":""},{"path":"/reference/chk_join.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Join — chk_join","text":"","code":"chk_join(x, y, by, x_name = NULL) vld_join(x, y, by)"},{"path":"/reference/chk_join.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Join — chk_join","text":"x object check. y data.frame columns . character vector specifying column names join x y . named names corresponding columns x. x_name string name object x NULL.","code":""},{"path":"/reference/chk_join.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Join — chk_join","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_join.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Join — chk_join","text":"vld_join(): Validate Join","code":""},{"path":[]},{"path":"/reference/chk_join.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Join — chk_join","text":"","code":"# chk_join chk_join(data.frame(z = 1), data.frame(z = 1:2), by = \"z\") try(chk_join(data.frame(z = 1), data.frame(z = 2), by = \"z\")) #> Error in eval(expr, envir, enclos) : #> All rows in `data.frame(z = 1)` must match at least one in the y object of class . #> Use `rlang::last_error()$y` to show the object compared to. # vld_join vld_join(data.frame(z = 1), data.frame(z = 1:2), by = \"z\") #> [1] TRUE vld_join(data.frame(z = 1), data.frame(z = 2), by = \"z\") #> [1] FALSE vld_join(data.frame(z = 1), data.frame(a = 1:2), by = c(z = \"a\")) #> [1] TRUE vld_join(data.frame(z = 1), data.frame(a = 2), by = c(z = \"a\")) #> [1] FALSE"},{"path":"/reference/chk_length.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Length — chk_length","title":"Check Length — chk_length","text":"Checks length particular value range using length(x) >= length && length(x) <= upper","code":""},{"path":"/reference/chk_length.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Length — chk_length","text":"","code":"chk_length(x, length = 1L, upper = length, x_name = NULL) vld_length(x, length = 1L, upper = length)"},{"path":"/reference/chk_length.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Length — chk_length","text":"x object check. length count length. upper count max length. x_name string name object x NULL.","code":""},{"path":"/reference/chk_length.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Length — chk_length","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_length.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Length — chk_length","text":"vld_length(): Validate Length","code":""},{"path":[]},{"path":"/reference/chk_length.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Length — chk_length","text":"","code":"# chk_length chk_length(\"text\") try(vld_length(\"text\", length = 2)) #> [1] FALSE # vld_length vld_length(2:1, 2) #> [1] TRUE vld_length(2:1, 1) #> [1] FALSE"},{"path":"/reference/chk_lgl.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Logical Scalar — chk_lgl","title":"Check Logical Scalar — chk_lgl","text":"Checks logical scalar using .logical(x) && length(x) == 1L","code":""},{"path":"/reference/chk_lgl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Logical Scalar — chk_lgl","text":"","code":"chk_lgl(x, x_name = NULL) vld_lgl(x)"},{"path":"/reference/chk_lgl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Logical Scalar — chk_lgl","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_lgl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Logical Scalar — chk_lgl","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_lgl.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Logical Scalar — chk_lgl","text":"vld_lgl(): Validate Logical Scalar","code":""},{"path":[]},{"path":"/reference/chk_lgl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Logical Scalar — chk_lgl","text":"","code":"# chk_lgl chk_lgl(NA) try(chk_lgl(1)) #> Error in eval(expr, envir, enclos) : #> `1` must be a logical scalar (TRUE, FALSE or NA). # vld_lgl vld_lgl(TRUE) #> [1] TRUE vld_lgl(FALSE) #> [1] TRUE vld_lgl(NA) #> [1] TRUE vld_lgl(1) #> [1] FALSE vld_lgl(c(TRUE, TRUE)) #> [1] FALSE"},{"path":"/reference/chk_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Check List — chk_list","title":"Check List — chk_list","text":"Checks list using .list(x)","code":""},{"path":"/reference/chk_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check List — chk_list","text":"","code":"chk_list(x, x_name = NULL) vld_list(x)"},{"path":"/reference/chk_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check List — chk_list","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check List — chk_list","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_list.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check List — chk_list","text":"vld_list(): Validate List","code":""},{"path":[]},{"path":"/reference/chk_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check List — chk_list","text":"","code":"# chk_list chk_list(list()) try(chk_list(1)) #> Error in eval(expr, envir, enclos) : `1` must be a list. # vld_list vld_list(list()) #> [1] TRUE vld_list(list(x = 1)) #> [1] TRUE vld_list(mtcars) #> [1] TRUE vld_list(1) #> [1] FALSE vld_list(NULL) #> [1] FALSE"},{"path":"/reference/chk_logical.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Logical — chk_logical","title":"Check Logical — chk_logical","text":"Checks logical using .logical(x)","code":""},{"path":"/reference/chk_logical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Logical — chk_logical","text":"","code":"chk_logical(x, x_name = NULL) vld_logical(x)"},{"path":"/reference/chk_logical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Logical — chk_logical","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_logical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Logical — chk_logical","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_logical.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Logical — chk_logical","text":"vld_logical(): Validate Logical","code":""},{"path":[]},{"path":"/reference/chk_logical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Logical — chk_logical","text":"","code":"# chk_logical chk_logical(TRUE) try(chk_logical(1)) #> Error in eval(expr, envir, enclos) : `1` must be logical. # vld_logical vld_logical(TRUE) #> [1] TRUE vld_logical(matrix(TRUE)) #> [1] TRUE vld_logical(logical(0)) #> [1] TRUE vld_logical(NA) #> [1] TRUE vld_logical(1) #> [1] FALSE vld_logical(\"TRUE\") #> [1] FALSE"},{"path":"/reference/chk_lt.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Less Than — chk_lt","title":"Check Less Than — chk_lt","text":"Checks non-missing values less value using (x[!.na(x)] < value)","code":""},{"path":"/reference/chk_lt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Less Than — chk_lt","text":"","code":"chk_lt(x, value = 0, x_name = NULL) vld_lt(x, value = 0)"},{"path":"/reference/chk_lt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Less Than — chk_lt","text":"x object check. value non-missing scalar value. x_name string name object x NULL.","code":""},{"path":"/reference/chk_lt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Less Than — chk_lt","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_lt.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Less Than — chk_lt","text":"vld_lt(): Validate Less ","code":""},{"path":[]},{"path":"/reference/chk_lt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Less Than — chk_lt","text":"","code":"# chk_lt chk_lt(-0.1) try(chk_lt(c(-0.1, 0.2))) #> Error in eval(expr, envir, enclos) : #> `c(-0.1, 0.2)` must have values less than 0. # vld_lt vld_lt(numeric(0)) #> [1] TRUE vld_lt(0) #> [1] FALSE vld_lt(-0.1) #> [1] TRUE vld_lt(c(-0.1, -0.2, NA)) #> [1] TRUE vld_lt(c(-0.1, 0.2)) #> [1] FALSE vld_lt(c(-0.1, 0.2), value = 1) #> [1] TRUE vld_lt(\"a\", value = \"b\") #> [1] TRUE"},{"path":"/reference/chk_lte.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Less Than or Equal To — chk_lte","title":"Check Less Than or Equal To — chk_lte","text":"Checks non-missing values less equal y using (x[!.na(x)] <= value)","code":""},{"path":"/reference/chk_lte.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Less Than or Equal To — chk_lte","text":"","code":"chk_lte(x, value = 0, x_name = NULL) vld_lte(x, value = 0)"},{"path":"/reference/chk_lte.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Less Than or Equal To — chk_lte","text":"x object check. value non-missing scalar value. x_name string name object x NULL.","code":""},{"path":"/reference/chk_lte.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Less Than or Equal To — chk_lte","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_lte.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Less Than or Equal To — chk_lte","text":"vld_lte(): Validate Less Equal ","code":""},{"path":[]},{"path":"/reference/chk_lte.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Less Than or Equal To — chk_lte","text":"","code":"# chk_lte chk_lte(0) try(chk_lte(0.1)) #> Error in eval(expr, envir, enclos) : #> `0.1` must be less than or equal to 0, not 0.1. # vld_lte vld_lte(numeric(0)) #> [1] TRUE vld_lte(0) #> [1] TRUE vld_lte(0.1) #> [1] FALSE vld_lte(c(-0.1, -0.2, NA)) #> [1] TRUE vld_lte(c(-0.1, -0.2, NA), value = -1) #> [1] FALSE"},{"path":"/reference/chk_match.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Matches — chk_match","title":"Check Matches — chk_match","text":"Checks values match regular expression using (grepl(regexp, x[!.na(x)]))","code":""},{"path":"/reference/chk_match.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Matches — chk_match","text":"","code":"chk_match(x, regexp = \".+\", x_name = NULL) vld_match(x, regexp = \".+\")"},{"path":"/reference/chk_match.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Matches — chk_match","text":"x object check. regexp string regular expression. x_name string name object x NULL.","code":""},{"path":"/reference/chk_match.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Matches — chk_match","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_match.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Matches — chk_match","text":"vld_match(): Validate Matches","code":""},{"path":[]},{"path":"/reference/chk_match.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Matches — chk_match","text":"","code":"# chk_match chk_match(\"1\") try(chk_match(\"1\", regexp = \"2\")) #> Error in eval(expr, envir, enclos) : #> `\"1\"` must match regular expression '2'. # vld_match vld_match(\"1\") #> [1] TRUE vld_match(\"a\", regexp = \"a\") #> [1] TRUE vld_match(\"\") #> [1] FALSE vld_match(\"1\", regexp = \"2\") #> [1] FALSE vld_match(NA_character_, regexp = \".*\") #> [1] TRUE"},{"path":"/reference/chk_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Matrix — chk_matrix","title":"Check Matrix — chk_matrix","text":"Checks matrix using .matrix(x)","code":""},{"path":"/reference/chk_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Matrix — chk_matrix","text":"","code":"chk_matrix(x, x_name = NULL) vld_matrix(x)"},{"path":"/reference/chk_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Matrix — chk_matrix","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Matrix — chk_matrix","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_matrix.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Matrix — chk_matrix","text":"vld_matrix(): Validate Matrix","code":""},{"path":[]},{"path":"/reference/chk_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Matrix — chk_matrix","text":"","code":"# chk_matrix chk_matrix(matrix(1)) try(chk_matrix(array(1))) #> Error in eval(expr, envir, enclos) : `array(1)` must be an matrix. # vld_matrix vld_matrix(1) #> [1] FALSE vld_matrix(matrix(1)) #> [1] TRUE"},{"path":"/reference/chk_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Missing Argument — chk_missing","title":"Check Missing Argument — chk_missing","text":"Checks argument missing using missing(x)","code":""},{"path":"/reference/chk_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Missing Argument — chk_missing","text":"","code":"chk_missing(x, x_name = NULL) vld_missing(x)"},{"path":"/reference/chk_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Missing Argument — chk_missing","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Missing Argument — chk_missing","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_missing.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Missing Argument — chk_missing","text":"Currently checks value available (opposed whether specified).","code":""},{"path":"/reference/chk_missing.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Missing Argument — chk_missing","text":"vld_missing(): Validate Missing Argument","code":""},{"path":[]},{"path":"/reference/chk_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Missing Argument — chk_missing","text":"","code":"# chk_missing fun <- function(x) { chk_missing(x) } fun() try(fun(1)) #> Error in fun(1) : `x` must be missing. # vld_missing fun <- function(x) { vld_missing(x) } fun() #> [1] TRUE fun(1) #> [1] FALSE"},{"path":"/reference/chk_named.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Named — chk_named","title":"Check Named — chk_named","text":"Checks named using !.null(names(x))","code":""},{"path":"/reference/chk_named.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Named — chk_named","text":"","code":"chk_named(x, x_name = NULL) vld_named(x)"},{"path":"/reference/chk_named.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Named — chk_named","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_named.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Named — chk_named","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_named.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Named — chk_named","text":"vld_named(): Validate Named","code":""},{"path":[]},{"path":"/reference/chk_named.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Named — chk_named","text":"","code":"# chk_named chk_named(c(x = 1)) try(chk_named(list(1))) #> Error in eval(expr, envir, enclos) : `list(1)` must be named. # vld_named vld_named(c(x = 1)) #> [1] TRUE vld_named(list(x = 1)) #> [1] TRUE vld_named(c(x = 1)[-1]) #> [1] TRUE vld_named(list(x = 1)[-1]) #> [1] TRUE vld_named(1) #> [1] FALSE vld_named(list(1)) #> [1] FALSE"},{"path":"/reference/chk_not_any_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Not Any Missing Values — chk_not_any_na","title":"Check Not Any Missing Values — chk_not_any_na","text":"Checks missing values using !anyNA(x) Pass: 1, 1:2, \"1\", logical(0). Fail: NA, c(1, NA).","code":""},{"path":"/reference/chk_not_any_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Not Any Missing Values — chk_not_any_na","text":"","code":"chk_not_any_na(x, x_name = NULL) vld_not_any_na(x)"},{"path":"/reference/chk_not_any_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Not Any Missing Values — chk_not_any_na","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_any_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Not Any Missing Values — chk_not_any_na","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_not_any_na.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Not Any Missing Values — chk_not_any_na","text":"vld_not_any_na(): Validate Missing Values","code":""},{"path":[]},{"path":"/reference/chk_not_any_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Not Any Missing Values — chk_not_any_na","text":"","code":"# chk_not_any_na chk_not_any_na(1) try(chk_not_any_na(NA)) #> Error in eval(expr, envir, enclos) : #> `NA` must not have any missing values. # vld_not_any_na vld_not_any_na(1) #> [1] TRUE vld_not_any_na(1:2) #> [1] TRUE vld_not_any_na(NA_real_) #> [1] FALSE vld_not_any_na(integer(0)) #> [1] TRUE vld_not_any_na(c(NA, 1)) #> [1] FALSE vld_not_any_na(TRUE) #> [1] TRUE"},{"path":"/reference/chk_not_empty.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Not Empty — chk_not_empty","title":"Check Not Empty — chk_not_empty","text":"Checks empty using length(x) != 0L Pass: 1, 1:2, NA, matrix(1:3), list(1), data.frame(x = 1). Fail: NULL, logical(0), list(), data.frame().","code":""},{"path":"/reference/chk_not_empty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Not Empty — chk_not_empty","text":"","code":"chk_not_empty(x, x_name = NULL) vld_not_empty(x)"},{"path":"/reference/chk_not_empty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Not Empty — chk_not_empty","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_empty.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Not Empty — chk_not_empty","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_not_empty.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Not Empty — chk_not_empty","text":"vld_not_empty(): Validate Empty","code":""},{"path":[]},{"path":"/reference/chk_not_empty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Not Empty — chk_not_empty","text":"","code":"# chk_not_empty chk_not_empty(1) try(chk_not_empty(numeric(0))) #> Error in eval(expr, envir, enclos) : #> `numeric(0)` must not be empty (zero length). # vld_not_empty vld_not_empty(1) #> [1] TRUE vld_not_empty(matrix(1:3)) #> [1] TRUE vld_not_empty(character(0)) #> [1] FALSE vld_not_empty(list(1)) #> [1] TRUE vld_not_empty(NULL) #> [1] FALSE vld_not_empty(list()) #> [1] FALSE"},{"path":"/reference/chk_not_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Not Missing Argument — chk_not_missing","title":"Check Not Missing Argument — chk_not_missing","text":"Checks argument missing using !missing(x)","code":""},{"path":"/reference/chk_not_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Not Missing Argument — chk_not_missing","text":"","code":"chk_not_missing(x, x_name = \"`x`\") vld_not_missing(x)"},{"path":"/reference/chk_not_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Not Missing Argument — chk_not_missing","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Not Missing Argument — chk_not_missing","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_not_missing.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Not Missing Argument — chk_not_missing","text":"Currently checks value available (opposed whether specified).","code":""},{"path":"/reference/chk_not_missing.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Not Missing Argument — chk_not_missing","text":"vld_not_missing(): Validate Missing Argument","code":""},{"path":[]},{"path":"/reference/chk_not_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Not Missing Argument — chk_not_missing","text":"","code":"# chk_not_missing fun <- function(x) { chk_not_missing(x) } fun(1) try(fun()) #> Error in fun() : `x` must not be missing. # vld_not_missing fun <- function(x) { vld_not_missing(x) } fun() #> [1] FALSE fun(1) #> [1] TRUE"},{"path":"/reference/chk_not_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Check not NULL — chk_not_null","title":"Check not NULL — chk_not_null","text":"Checks NULL using !.null(x)","code":""},{"path":"/reference/chk_not_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check not NULL — chk_not_null","text":"","code":"chk_not_null(x, x_name = NULL) vld_not_null(x)"},{"path":"/reference/chk_not_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check not NULL — chk_not_null","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check not NULL — chk_not_null","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_not_null.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check not NULL — chk_not_null","text":"vld_not_null(): Validate NULL","code":""},{"path":[]},{"path":"/reference/chk_not_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check not NULL — chk_not_null","text":"","code":"# chk_not_null try(chk_not_null(NULL)) #> Error in eval(expr, envir, enclos) : `NULL` must not be NULL. chk_not_null(1) # vld_not_null vld_not_null(1) #> [1] TRUE vld_not_null(NULL) #> [1] FALSE"},{"path":"/reference/chk_not_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Not Subset — chk_not_subset","title":"Check Not Subset — chk_not_subset","text":"Checks values values using !(x %% values) || !length(x)","code":""},{"path":"/reference/chk_not_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Not Subset — chk_not_subset","text":"","code":"chk_not_subset(x, values, x_name = NULL)"},{"path":"/reference/chk_not_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Not Subset — chk_not_subset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Not Subset — chk_not_subset","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":[]},{"path":"/reference/chk_not_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Not Subset — chk_not_subset","text":"","code":"# chk_not_subset chk_not_subset(11, 1:10) try(chk_not_subset(1, 1:10)) #> Error in eval(expr, envir, enclos) : #> `1` must not match 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10."},{"path":"/reference/chk_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Check NULL — chk_null","title":"Check NULL — chk_null","text":"Checks NULL using .null(x)","code":""},{"path":"/reference/chk_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check NULL — chk_null","text":"","code":"chk_null(x, x_name = NULL) vld_null(x)"},{"path":"/reference/chk_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check NULL — chk_null","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check NULL — chk_null","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_null.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check NULL — chk_null","text":"vld_null(): Validate NULL","code":""},{"path":[]},{"path":"/reference/chk_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check NULL — chk_null","text":"","code":"# chk_null try(chk_null(1)) #> Error in eval(expr, envir, enclos) : `1` must be NULL. chk_null(NULL) # vld_null vld_null(NULL) #> [1] TRUE vld_null(1) #> [1] FALSE"},{"path":"/reference/chk_null_or.html","id":null,"dir":"Reference","previous_headings":"","what":"Check NULL Or — chk_null_or","title":"Check NULL Or — chk_null_or","text":"Checks NULL passes test.","code":""},{"path":"/reference/chk_null_or.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check NULL Or — chk_null_or","text":"","code":"chk_null_or(x, chk, ..., vld, x_name = NULL)"},{"path":"/reference/chk_null_or.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check NULL Or — chk_null_or","text":"x object check. chk chk function. Soft-deprecated vld. ... Arguments passed chk. vld vld function. x_name string name object x NULL.","code":""},{"path":"/reference/chk_null_or.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check NULL Or — chk_null_or","text":"informative error test fails.","code":""},{"path":"/reference/chk_null_or.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check NULL Or — chk_null_or","text":"","code":"chk_null_or(NULL, chk_number) #> Warning: The `chk` argument of `chk_null_or()` is deprecated as of chk 0.6.1. #> ℹ Please use the `vld` argument instead. chk_null_or(1, chk_number) try(chk_null_or(\"1\", chk_number)) #> Error in eval(expr, envir, enclos) : #> `\"1\"` must be a number (non-missing numeric scalar) or NULL."},{"path":"/reference/chk_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Number — chk_number","title":"Check Number — chk_number","text":"Checks non-missing numeric scalar using .numeric(x) && length(x) == 1L && !anyNA(x) Pass: 1, 2L, log(10), -Inf Fail: \"\", 1:3, NA_real_","code":""},{"path":"/reference/chk_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Number — chk_number","text":"","code":"chk_number(x, x_name = NULL) vld_number(x)"},{"path":"/reference/chk_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Number — chk_number","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Number — chk_number","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_number.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Number — chk_number","text":"vld_number(): Validate Number","code":""},{"path":[]},{"path":"/reference/chk_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Number — chk_number","text":"","code":"# chk_number chk_number(1.1) try(chk_number(TRUE)) #> Error in eval(expr, envir, enclos) : #> `TRUE` must be a number (non-missing numeric scalar). # vld_number vld_number(1.1) #> [1] TRUE"},{"path":"/reference/chk_numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Numeric — chk_numeric","title":"Check Numeric — chk_numeric","text":"Checks numeric using .numeric(x) Pass: 1, 1:2, NA_real_, integer(0), matrix(1:3). Fail: TRUE, \"1\", NA, NULL.","code":""},{"path":"/reference/chk_numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Numeric — chk_numeric","text":"","code":"chk_numeric(x, x_name = NULL) vld_numeric(x)"},{"path":"/reference/chk_numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Numeric — chk_numeric","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_numeric.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Numeric — chk_numeric","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_numeric.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Numeric — chk_numeric","text":"vld_numeric(): Validate Numeric","code":""},{"path":[]},{"path":"/reference/chk_numeric.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Numeric — chk_numeric","text":"","code":"# chk_numeric chk_numeric(1) try(chk_numeric(\"1\")) #> Error in eval(expr, envir, enclos) : `\"1\"` must be numeric. # vld_numeric vld_numeric(1) #> [1] TRUE vld_numeric(1:2) #> [1] TRUE vld_numeric(NA_real_) #> [1] TRUE vld_numeric(integer(0)) #> [1] TRUE vld_numeric(\"1\") #> [1] FALSE vld_numeric(TRUE) #> [1] FALSE"},{"path":"/reference/chk_orderset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Set Ordered — chk_orderset","title":"Check Set Ordered — chk_orderset","text":"Checks first occurrence shared element x equivalent first occurrence shared element values using vld_equivalent(unique(x[x %% values]), values[values %% x]).","code":""},{"path":"/reference/chk_orderset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Set Ordered — chk_orderset","text":"","code":"chk_orderset(x, values, x_name = NULL)"},{"path":"/reference/chk_orderset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Set Ordered — chk_orderset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_orderset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Set Ordered — chk_orderset","text":"chk_ function throws informative error test fails. vld_ function returns flag indicating whether test met.","code":""},{"path":[]},{"path":"/reference/chk_orderset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Set Ordered — chk_orderset","text":"","code":"# chk_orderset chk_orderset(1:2, 1:2) try(chk_orderset(2:1, 1:2)) #> Error in eval(expr, envir, enclos) : #> `2:1` must have (the first occurence of) each of the following elements in the following order: 1, 2."},{"path":"/reference/chk_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks range of non-missing values — chk_range","title":"Checks range of non-missing values — chk_range","text":"Checks non-missing values fall within range using inclusive (x[!.na(x)] >= range[1] & x[!.na(x)] <= range[2]) else (x[!.na(x)] > range[1] & x[!.na(x)] < range[2])","code":""},{"path":"/reference/chk_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks range of non-missing values — chk_range","text":"","code":"chk_range(x, range = c(0, 1), inclusive = TRUE, x_name = NULL) vld_range(x, range = c(0, 1), inclusive = TRUE)"},{"path":"/reference/chk_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks range of non-missing values — chk_range","text":"x object check. range non-missing sorted vector length 2 lower upper permitted values. inclusive flag specifying whether range exclusive. x_name string name object x NULL.","code":""},{"path":"/reference/chk_range.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Checks range of non-missing values — chk_range","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_range.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Checks range of non-missing values — chk_range","text":"vld_range(): Validate Range","code":""},{"path":[]},{"path":"/reference/chk_range.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Checks range of non-missing values — chk_range","text":"","code":"# chk_range chk_range(0) try(chk_range(-0.1)) #> Error in eval(expr, envir, enclos) : #> `-0.1` must be between 0 and 1, not -0.1. # vld_range vld_range(numeric(0)) #> [1] TRUE vld_range(0) #> [1] TRUE vld_range(-0.1) #> [1] FALSE vld_range(c(0.1, 0.2, NA)) #> [1] TRUE vld_range(c(0.1, 0.2, NA), range = c(0, 1)) #> [1] TRUE"},{"path":"/reference/chk_s3_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Type — chk_s3_class","title":"Check Type — chk_s3_class","text":"Checks inherits S3 class using !isS4(x) && inherits(x, class)","code":""},{"path":"/reference/chk_s3_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Type — chk_s3_class","text":"","code":"chk_s3_class(x, class, x_name = NULL) vld_s3_class(x, class)"},{"path":"/reference/chk_s3_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Type — chk_s3_class","text":"x object check. class string specifying class. x_name string name object x NULL.","code":""},{"path":"/reference/chk_s3_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Type — chk_s3_class","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_s3_class.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Type — chk_s3_class","text":"vld_s3_class(): Validate Inherits S3 Class","code":""},{"path":[]},{"path":"/reference/chk_s3_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Type — chk_s3_class","text":"","code":"# chk_s3_class chk_s3_class(1, \"numeric\") try(chk_s3_class(getClass(\"MethodDefinition\"), \"classRepresentation\")) #> Error in eval(expr, envir, enclos) : #> `getClass(\"MethodDefinition\")` must inherit from S3 class 'classRepresentation'. # vld_s3_class vld_s3_class(numeric(0), \"numeric\") #> [1] TRUE vld_s3_class(getClass(\"MethodDefinition\"), \"classRepresentation\") #> [1] FALSE"},{"path":"/reference/chk_s4_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Inherits from S4 Class — chk_s4_class","title":"Check Inherits from S4 Class — chk_s4_class","text":"Checks inherits S4 class using isS4(x) && methods::(x, class)","code":""},{"path":"/reference/chk_s4_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Inherits from S4 Class — chk_s4_class","text":"","code":"chk_s4_class(x, class, x_name = NULL) vld_s4_class(x, class)"},{"path":"/reference/chk_s4_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Inherits from S4 Class — chk_s4_class","text":"x object check. class string specifying class. x_name string name object x NULL.","code":""},{"path":"/reference/chk_s4_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Inherits from S4 Class — chk_s4_class","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_s4_class.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Inherits from S4 Class — chk_s4_class","text":"vld_s4_class(): Validate Inherits S4 Class","code":""},{"path":[]},{"path":"/reference/chk_s4_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Inherits from S4 Class — chk_s4_class","text":"","code":"# chk_s4_class try(chk_s4_class(1, \"numeric\")) #> Error in eval(expr, envir, enclos) : #> `1` must inherit from S4 class 'numeric'. chk_s4_class(getClass(\"MethodDefinition\"), \"classRepresentation\") # vld_s4_class vld_s4_class(numeric(0), \"numeric\") #> [1] FALSE vld_s4_class(getClass(\"MethodDefinition\"), \"classRepresentation\") #> [1] TRUE"},{"path":"/reference/chk_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Scalar — chk_scalar","title":"Check Scalar — chk_scalar","text":"Checks vector using length(x) == 1L","code":""},{"path":"/reference/chk_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Scalar — chk_scalar","text":"","code":"chk_scalar(x, x_name = NULL) vld_scalar(x)"},{"path":"/reference/chk_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Scalar — chk_scalar","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Scalar — chk_scalar","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_scalar.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Scalar — chk_scalar","text":"vld_scalar(): Validate Scalar","code":""},{"path":[]},{"path":"/reference/chk_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Scalar — chk_scalar","text":"","code":"# chk_scalar chk_scalar(1) chk_scalar(list(1)) try(chk_scalar(1:2)) #> Error in eval(expr, envir, enclos) : `1:2` must be a scalar (length 1). # vld_scalar vld_scalar(1) #> [1] TRUE"},{"path":"/reference/chk_setequal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Set Equal — vld_orderset","title":"Check Set Equal — vld_orderset","text":"Checks equal set using setequal(x, values)","code":""},{"path":"/reference/chk_setequal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Set Equal — vld_orderset","text":"","code":"vld_orderset(x, values) chk_setequal(x, values, x_name = NULL) vld_setequal(x, values)"},{"path":"/reference/chk_setequal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Set Equal — vld_orderset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_setequal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Set Equal — vld_orderset","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_setequal.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Set Equal — vld_orderset","text":"vld_orderset(): Validate Set Ordered vld_setequal(): Validate Set Equal","code":""},{"path":[]},{"path":"/reference/chk_setequal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Set Equal — vld_orderset","text":"","code":"# vld_orderset vld_orderset(1, 1) #> [1] TRUE vld_orderset(1:2, 2:1) #> [1] FALSE vld_orderset(1, 2:1) #> [1] TRUE vld_orderset(1:2, 2) #> [1] TRUE # chk_setequal chk_setequal(1:2, 2:1) try(chk_setequal(1, 1:2)) #> Error in eval(expr, envir, enclos) : `1` must equal set: 1, 2. # vld_setequal vld_setequal(1, 1) #> [1] TRUE vld_setequal(1:2, 2:1) #> [1] TRUE vld_setequal(1, 2:1) #> [1] FALSE vld_setequal(1:2, 2) #> [1] FALSE"},{"path":"/reference/chk_sorted.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Sorted — chk_sorted","title":"Check Sorted — chk_sorted","text":"Checks sorted using .unsorted(x, na.rm = TRUE)","code":""},{"path":"/reference/chk_sorted.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Sorted — chk_sorted","text":"","code":"chk_sorted(x, x_name = NULL) vld_sorted(x)"},{"path":"/reference/chk_sorted.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Sorted — chk_sorted","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_sorted.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Sorted — chk_sorted","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_sorted.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Sorted — chk_sorted","text":"vld_sorted(): Validate Sorted","code":""},{"path":[]},{"path":"/reference/chk_sorted.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Sorted — chk_sorted","text":"","code":"# chk_sorted chk_sorted(1:2) try(chk_sorted(2:1)) #> Error in eval(expr, envir, enclos) : `2:1` must be sorted. # vld_sorted vld_sorted(1:2) #> [1] TRUE vld_sorted(2:1) #> [1] FALSE"},{"path":"/reference/chk_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Check String — chk_string","title":"Check String — chk_string","text":"Checks string .character(x) && length(x) == 1L && !anyNA(x)","code":""},{"path":"/reference/chk_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check String — chk_string","text":"","code":"chk_string(x, x_name = NULL) vld_string(x)"},{"path":"/reference/chk_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check String — chk_string","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check String — chk_string","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_string.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check String — chk_string","text":"vld_string(): Validate String","code":""},{"path":[]},{"path":"/reference/chk_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check String — chk_string","text":"","code":"# chk_string chk_string(\"1\") try(chk_string(1)) #> Error in eval(expr, envir, enclos) : #> `1` must be a string (non-missing character scalar). # vld_string vld_string(\"1\") #> [1] TRUE vld_string(\"\") #> [1] TRUE vld_string(1) #> [1] FALSE vld_string(NA_character_) #> [1] FALSE vld_string(c(\"1\", \"1\")) #> [1] FALSE"},{"path":"/reference/chk_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Subset — vld_not_subset","title":"Check Subset — vld_not_subset","text":"Checks values values using (x %% values)","code":""},{"path":"/reference/chk_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Subset — vld_not_subset","text":"","code":"vld_not_subset(x, values) chk_subset(x, values, x_name = NULL) vld_subset(x, values)"},{"path":"/reference/chk_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Subset — vld_not_subset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Subset — vld_not_subset","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_subset.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Subset — vld_not_subset","text":"vld_not_subset(): Validate Subset vld_subset(): Validate Subset","code":""},{"path":[]},{"path":"/reference/chk_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Subset — vld_not_subset","text":"","code":"# vld_not_subset vld_not_subset(numeric(0), 1:10) #> [1] TRUE vld_not_subset(1, 1:10) #> [1] FALSE vld_not_subset(11, 1:10) #> [1] TRUE # chk_subset chk_subset(1, 1:10) try(chk_subset(11, 1:10)) #> Error in eval(expr, envir, enclos) : #> `11` must match 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10, not 11. # vld_subset vld_subset(numeric(0), 1:10) #> [1] TRUE vld_subset(1, 1:10) #> [1] TRUE vld_subset(11, 1:10) #> [1] FALSE"},{"path":"/reference/chk_superset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Superset — chk_superset","title":"Check Superset — chk_superset","text":"Checks includes values using (values %% x)","code":""},{"path":"/reference/chk_superset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Superset — chk_superset","text":"","code":"chk_superset(x, values, x_name = NULL) vld_superset(x, values)"},{"path":"/reference/chk_superset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Superset — chk_superset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_superset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Superset — chk_superset","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_superset.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Superset — chk_superset","text":"vld_superset(): Validates Superset","code":""},{"path":[]},{"path":"/reference/chk_superset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Superset — chk_superset","text":"","code":"# chk_superset chk_superset(1:3, 1) try(chk_superset(1:3, 4)) #> Error in eval(expr, envir, enclos) : `1:3` must include 4. # vld_superset vld_superset(1:3, 1) #> [1] TRUE vld_superset(1:3, 4) #> [1] FALSE vld_superset(integer(0), integer(0)) #> [1] TRUE"},{"path":"/reference/chk_true.html","id":null,"dir":"Reference","previous_headings":"","what":"Check TRUE — chk_true","title":"Check TRUE — chk_true","text":"Checks TRUE using .logical(x) && length(x) == 1L && !anyNA(x) && x","code":""},{"path":"/reference/chk_true.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check TRUE — chk_true","text":"","code":"chk_true(x, x_name = NULL) vld_true(x)"},{"path":"/reference/chk_true.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check TRUE — chk_true","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_true.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check TRUE — chk_true","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_true.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check TRUE — chk_true","text":"vld_true(): Validate TRUE","code":""},{"path":[]},{"path":"/reference/chk_true.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check TRUE — chk_true","text":"","code":"# chk_true chk_true(TRUE) try(chk_true(1)) #> Error in eval(expr, envir, enclos) : `1` must be TRUE. # vld_true vld_true(TRUE) #> [1] TRUE vld_true(FALSE) #> [1] FALSE vld_true(NA) #> [1] FALSE vld_true(0) #> [1] FALSE vld_true(c(TRUE, TRUE)) #> [1] FALSE"},{"path":"/reference/chk_tz.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Time Zone — chk_tz","title":"Check Time Zone — chk_tz","text":"Checks non-missing valid scalar timezone using .character(x) && length(x) == 1L && !anyNA(x) && x %% OlsonNames()","code":""},{"path":"/reference/chk_tz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Time Zone — chk_tz","text":"","code":"chk_tz(x, x_name = NULL) vld_tz(x)"},{"path":"/reference/chk_tz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Time Zone — chk_tz","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_tz.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Time Zone — chk_tz","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_tz.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Time Zone — chk_tz","text":"vld_tz(): Validate Time Zone","code":""},{"path":[]},{"path":"/reference/chk_tz.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Time Zone — chk_tz","text":"","code":"chk_tz(\"UTC\") try(chk_tz(\"TCU\")) #> Error in eval(expr, envir, enclos) : #> `\"TCU\"` must be a tz (non-missing scalar character of a recognized timezone). vld_tz(\"UTC\") #> [1] TRUE vld_tz(\"TCU\") #> [1] FALSE"},{"path":"/reference/chk_unique.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Unique — chk_unique","title":"Check Unique — chk_unique","text":"Checks unique using !anyDuplicated(x, incomparables = incomparables)","code":""},{"path":"/reference/chk_unique.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Unique — chk_unique","text":"","code":"chk_unique(x, incomparables = FALSE, x_name = NULL) vld_unique(x, incomparables = FALSE)"},{"path":"/reference/chk_unique.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Unique — chk_unique","text":"x object check. incomparables vector values compared. FALSE means values can compared. x_name string name object x NULL.","code":""},{"path":"/reference/chk_unique.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Unique — chk_unique","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_unique.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Unique — chk_unique","text":"vld_unique(): Validate Unique","code":""},{"path":[]},{"path":"/reference/chk_unique.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Unique — chk_unique","text":"","code":"# chk_unique chk_unique(c(NA, 2)) try(chk_unique(c(NA, NA, 2))) #> Error in eval(expr, envir, enclos) : `c(NA, NA, 2)` must be unique. chk_unique(c(NA, NA, 2), incomparables = NA) # vld_unique vld_unique(NULL) #> [1] TRUE vld_unique(numeric(0)) #> [1] TRUE vld_unique(c(NA, 2)) #> [1] TRUE vld_unique(c(NA, NA, 2)) #> [1] FALSE vld_unique(c(NA, NA, 2), incomparables = NA) #> [1] TRUE"},{"path":"/reference/chk_unused.html","id":null,"dir":"Reference","previous_headings":"","what":"Check ... Unused — chk_unused","title":"Check ... Unused — chk_unused","text":"Checks ... unused length(list(...)) == 0L","code":""},{"path":"/reference/chk_unused.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check ... Unused — chk_unused","text":"","code":"chk_unused(...) vld_unused(...)"},{"path":"/reference/chk_unused.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check ... Unused — chk_unused","text":"... Additional arguments.","code":""},{"path":"/reference/chk_unused.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check ... Unused — chk_unused","text":"chk_ function throws informative error test fails.","code":""},{"path":"/reference/chk_unused.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check ... Unused — chk_unused","text":"vld_unused(): Validate ... Unused","code":""},{"path":[]},{"path":"/reference/chk_unused.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check ... Unused — chk_unused","text":"","code":"# chk_unused fun <- function(x, ...) { chk_unused(...) x } fun(1) #> [1] 1 try(fun(1, 2)) #> Error in fun(1, 2) : `...` must be unused. # vld_unused fun <- function(x, ...) { vld_unused(...) } fun(1) #> [1] TRUE try(fun(1, 2)) #> [1] FALSE"},{"path":"/reference/chk_used.html","id":null,"dir":"Reference","previous_headings":"","what":"Check ... Used — chk_used","title":"Check ... Used — chk_used","text":"Checks ... used using length(list(...)) != 0L","code":""},{"path":"/reference/chk_used.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check ... Used — chk_used","text":"","code":"chk_used(...) vld_used(...)"},{"path":"/reference/chk_used.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check ... Used — chk_used","text":"... Additional arguments.","code":""},{"path":"/reference/chk_used.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check ... Used — chk_used","text":"chk_ function throws informative error test fails.","code":""},{"path":"/reference/chk_used.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check ... Used — chk_used","text":"vld_used(): Validate ... Used","code":""},{"path":[]},{"path":"/reference/chk_used.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check ... Used — chk_used","text":"","code":"# chk_used fun <- function(x, ...) { chk_used(...) x } try(fun(1)) #> Error in fun(1) : `...` must be used. fun(1, 2) #> [1] 1 # vld_used fun <- function(x, ...) { vld_used(...) } fun(1) #> [1] FALSE fun(1, 2) #> [1] TRUE"},{"path":"/reference/chk_valid_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Valid Name — chk_valid_name","title":"Check Valid Name — chk_valid_name","text":"Checks valid name using identical(make.names(x[!.na(x)]), .character(x[!.na(x)]))","code":""},{"path":"/reference/chk_valid_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Valid Name — chk_valid_name","text":"","code":"chk_valid_name(x, x_name = NULL) vld_valid_name(x)"},{"path":"/reference/chk_valid_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Valid Name — chk_valid_name","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_valid_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Valid Name — chk_valid_name","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_valid_name.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Valid Name — chk_valid_name","text":"vld_valid_name(): Validate Valid Name","code":""},{"path":[]},{"path":"/reference/chk_valid_name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Valid Name — chk_valid_name","text":"","code":"# chk_valid_name chk_valid_name(\"text\") try(chk_valid_name(\".1\")) #> Error in eval(expr, envir, enclos) : `\".1\"` must be valid name. # vld_valid_name vld_valid_name(\".1\") #> [1] FALSE"},{"path":"/reference/chk_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Vector — chk_vector","title":"Check Vector — chk_vector","text":"Checks vector using (.atomic(x) && !.matrix(x) && !.array(x)) || .list(x)","code":""},{"path":"/reference/chk_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Vector — chk_vector","text":"","code":"chk_vector(x, x_name = NULL) vld_vector(x)"},{"path":"/reference/chk_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Vector — chk_vector","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Vector — chk_vector","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_vector.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Vector — chk_vector","text":".vector(x) reliable returns TRUE object vector attributes apart names.","code":""},{"path":"/reference/chk_vector.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Vector — chk_vector","text":"vld_vector(): Validate Vector","code":""},{"path":[]},{"path":"/reference/chk_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Vector — chk_vector","text":"","code":"# chk_vector chk_vector(1) chk_vector(list()) try(chk_vector(matrix(1))) #> Error in eval(expr, envir, enclos) : `matrix(1)` must be a vector. # vld_vector vld_vector(1) #> [1] TRUE"},{"path":"/reference/chk_whole_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Whole Number — chk_whole_number","title":"Check Whole Number — chk_whole_number","text":"Checks non-missing integer scalar double equivalent using vld_number(x) && (.integer(x) || vld_true(.equal(x, trunc(x)))) Pass: 1, 2L, 1e10, -Inf Fail: \"\", 1:3, NA_integer_, log(10)","code":""},{"path":"/reference/chk_whole_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Whole Number — chk_whole_number","text":"","code":"chk_whole_number(x, x_name = NULL) vld_whole_number(x)"},{"path":"/reference/chk_whole_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Whole Number — chk_whole_number","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_whole_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Whole Number — chk_whole_number","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_whole_number.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Whole Number — chk_whole_number","text":"vld_whole_number(): Validate Whole Number","code":""},{"path":[]},{"path":"/reference/chk_whole_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Whole Number — chk_whole_number","text":"","code":"# chk_whole_number chk_whole_number(2) try(chk_whole_number(1.1)) #> Error in eval(expr, envir, enclos) : #> `1.1` must be a whole number (non-missing integer scalar or double equivalent). # vld_whole_number vld_whole_number(2) #> [1] TRUE"},{"path":"/reference/chk_whole_numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Whole Numeric — chk_whole_numeric","title":"Check Whole Numeric — chk_whole_numeric","text":"Checks integer vector double equivalent using .integer(x) || (.double(x) && vld_true(.equal(x, .integer(x))))","code":""},{"path":"/reference/chk_whole_numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Whole Numeric — chk_whole_numeric","text":"","code":"chk_whole_numeric(x, x_name = NULL) vld_whole_numeric(x)"},{"path":"/reference/chk_whole_numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Whole Numeric — chk_whole_numeric","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_whole_numeric.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Whole Numeric — chk_whole_numeric","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_whole_numeric.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Whole Numeric — chk_whole_numeric","text":"vld_whole_numeric(): Validate Whole Numeric","code":""},{"path":[]},{"path":"/reference/chk_whole_numeric.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Whole Numeric — chk_whole_numeric","text":"","code":"# chk_whole_numeric chk_whole_numeric(1) try(chk_whole_numeric(1.1)) #> Error in eval(expr, envir, enclos) : #> `1.1` must be a whole numeric vector (integer vector or double equivalent). # vld_whole_numeric vld_whole_numeric(1) #> [1] TRUE vld_whole_numeric(NA_real_) #> [1] TRUE vld_whole_numeric(1:2) #> [1] TRUE vld_whole_numeric(double(0)) #> [1] TRUE vld_whole_numeric(TRUE) #> [1] FALSE vld_whole_numeric(1.5) #> [1] FALSE"},{"path":"/reference/chk_wnum.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Whole Numeric Scalar — chk_wnum","title":"Check Whole Numeric Scalar — chk_wnum","text":"Checks whole numeric scalar using .numeric(x) && length(x) == 1L && (.integer(x) || vld_true(.equal(x, trunc(x))))","code":""},{"path":"/reference/chk_wnum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Whole Numeric Scalar — chk_wnum","text":"","code":"chk_wnum(x, x_name = NULL) vld_wnum(x)"},{"path":"/reference/chk_wnum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Whole Numeric Scalar — chk_wnum","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_wnum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Whole Numeric Scalar — chk_wnum","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_wnum.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Whole Numeric Scalar — chk_wnum","text":"vld_wnum(): Validate Whole Numeric Scalar","code":""},{"path":[]},{"path":"/reference/chk_wnum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Whole Numeric Scalar — chk_wnum","text":"","code":"# chk_wnum chk_wnum(1) try(chk_wnum(1.1)) #> Warning: `chk_wnum()` was deprecated in chk 0.6.1. #> ℹ Please use `chk::chk_scalar(x);` `chk::chk_whole_numeric(x)` instead #> Error in eval(expr, envir, enclos) : #> `1.1` must be a whole numeric scalar. # vld_wnum vld_wnum(1) #> [1] TRUE vld_wnum(double(0)) #> [1] FALSE vld_wnum(NA_real_) #> [1] TRUE vld_wnum(c(1, 1)) #> [1] FALSE vld_wnum(1L) #> [1] TRUE"},{"path":"/reference/chkor.html","id":null,"dir":"Reference","previous_headings":"","what":"Check OR — chkor","title":"Check OR — chkor","text":"chkor() function deprecated faster chkor_vld().","code":""},{"path":"/reference/chkor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check OR — chkor","text":"","code":"chkor(...)"},{"path":"/reference/chkor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check OR — chkor","text":"... Multiple chk_ functions.","code":""},{"path":"/reference/chkor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check OR — chkor","text":"informative error test fails.","code":""},{"path":[]},{"path":[]},{"path":"/reference/chkor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check OR — chkor","text":"","code":"chkor() #> Warning: `chkor()` was deprecated in chk 0.6.1. #> ℹ Please use `chkor_vld()` instead. chkor(chk_flag(TRUE)) try(chkor(chk_flag(1))) #> Error in chkor(chk_flag(1)) : `1` must be a flag (TRUE or FALSE). try(chkor(chk_flag(1), chk_flag(2))) #> Error in chkor(chk_flag(1), chk_flag(2)) : #> At least one of the following conditions must be met: #> * `1` must be a flag (TRUE or FALSE). #> * `2` must be a flag (TRUE or FALSE). chkor(chk_flag(1), chk_flag(TRUE))"},{"path":"/reference/chkor_vld.html","id":null,"dir":"Reference","previous_headings":"","what":"Chk OR — chkor_vld","title":"Chk OR — chkor_vld","text":"Chk ","code":""},{"path":"/reference/chkor_vld.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Chk OR — chkor_vld","text":"","code":"chkor_vld(...)"},{"path":"/reference/chkor_vld.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Chk OR — chkor_vld","text":"... Multiple vld_ calls. common mistake pass chk_ calls. chkor_vld() relatively slow. possible use chk_null_or() first test using individual vld_ functions call chkor_vld() generate informative error message.","code":""},{"path":"/reference/chkor_vld.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Chk OR — chkor_vld","text":"informative error test fails.","code":""},{"path":[]},{"path":"/reference/chkor_vld.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Chk OR — chkor_vld","text":"","code":"chkor_vld() chkor_vld(vld_flag(TRUE)) try(chkor_vld(vld_flag(1))) #> Error in chkor_vld(vld_flag(1)) : `1` must be a flag (TRUE or FALSE). try(chkor_vld(vld_flag(1), vld_flag(2))) #> Error in chkor_vld(vld_flag(1), vld_flag(2)) : #> At least one of the following conditions must be met: #> * `1` must be a flag (TRUE or FALSE). #> * `2` must be a flag (TRUE or FALSE). chkor_vld(vld_flag(1), vld_flag(TRUE))"},{"path":"/reference/deparse_backtick_chk.html","id":null,"dir":"Reference","previous_headings":"","what":"Deparse Backtick — deparse_backtick_chk","title":"Deparse Backtick — deparse_backtick_chk","text":"deparse_backtick_chk wrapper deparse() backtick_chk.","code":""},{"path":"/reference/deparse_backtick_chk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deparse Backtick — deparse_backtick_chk","text":"","code":"deparse_backtick_chk(x) backtick_chk(x) unbacktick_chk(x)"},{"path":"/reference/deparse_backtick_chk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deparse Backtick — deparse_backtick_chk","text":"x substituted object deparse.","code":""},{"path":"/reference/deparse_backtick_chk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deparse Backtick — deparse_backtick_chk","text":"string backticked substituted object.","code":""},{"path":"/reference/deparse_backtick_chk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Deparse Backtick — deparse_backtick_chk","text":"exported allow users easily construct chk_ functions.","code":""},{"path":"/reference/deparse_backtick_chk.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Deparse Backtick — deparse_backtick_chk","text":"backtick_chk(): Backtick unbacktick_chk(): Unbacktick","code":""},{"path":[]},{"path":"/reference/deparse_backtick_chk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deparse Backtick — deparse_backtick_chk","text":"","code":"# deparse_backtick_chk deparse_backtick_chk(2) #> [1] \"`2`\" deparse_backtick_chk(2^2) #> [1] \"`4`\""},{"path":"/reference/err.html","id":null,"dir":"Reference","previous_headings":"","what":"Stop, Warning and Message Messages — err","title":"Stop, Warning and Message Messages — err","text":"functions call message_chk() process message rlang::abort(), rlang::warn() rlang::inform(), respectively.","code":""},{"path":"/reference/err.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Stop, Warning and Message Messages — err","text":"","code":"err( ..., n = NULL, tidy = TRUE, .subclass = NULL, class = NULL, call = rlang::caller_call(3) ) wrn(..., n = NULL, tidy = TRUE, .subclass = NULL, class = NULL) msg(..., n = NULL, tidy = TRUE, .subclass = NULL, class = NULL)"},{"path":"/reference/err.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stop, Warning and Message Messages — err","text":"... zero objects can coerced character (pasted together separator) single condition object. n value n converting sprintf-like types. tidy flag specifying whether capitalize first character add missing period. .subclass string class error message. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"/reference/err.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Stop, Warning and Message Messages — err","text":"user can set subclass.","code":""},{"path":"/reference/err.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Stop, Warning and Message Messages — err","text":"err(): Error wrn(): Warning msg(): Message","code":""},{"path":"/reference/err.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Stop, Warning and Message Messages — err","text":"","code":"# err try(err(\"there %r %n problem value%s\", n = 2)) #> Error in eval_with_user_handlers(expr, envir, enclos, user_handlers) : #> There are 2 problem values. # wrn wrn(\"there %r %n problem value%s\", n = 2) #> Warning: There are 2 problem values. # msg msg(\"there %r %n problem value%s\", n = 2) #> There are 2 problem values."},{"path":"/reference/expect_chk_error.html","id":null,"dir":"Reference","previous_headings":"","what":"Expect Chk Error — expect_chk_error","title":"Expect Chk Error — expect_chk_error","text":"expect_chk_error() checks code throws error class \"chk_error\" message matches regexp. See details.","code":""},{"path":"/reference/expect_chk_error.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Expect Chk Error — expect_chk_error","text":"","code":"expect_chk_error( object, regexp = NULL, ..., info = NULL, label = NULL, class = NULL )"},{"path":"/reference/expect_chk_error.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Expect Chk Error — expect_chk_error","text":"object Object test. Supports limited unquoting make easier generate readable failures within function loop. See quasi_label details. regexp Regular expression test . character vector giving regular expression must match error message. NULL, default, asserts error, test specific value. NA, asserts errors, now recommend using expect_no_error() friends instead. Note use message errors/warnings/messages generate. Avoid tests rely specific text generated another package since can easily change. need test text generated another package, either protect test skip_on_cran() use expect_snapshot(). ... Arguments passed expect_match fixed TRUE, treats regexp string matched exactly (regular expressions). Overrides perl. perl logical. Perl-compatible regexps used? info Extra information included message. argument soft-deprecated used new code. Instead see alternatives quasi_label. label Used customise failure messages. expert use . class Must NULL.","code":""},{"path":"/reference/expect_chk_error.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Expect Chk Error — expect_chk_error","text":"regexp = NA, value first argument; otherwise captured condition.","code":""},{"path":"/reference/expect_chk_error.html","id":"testing-message-vs-class","dir":"Reference","previous_headings":"","what":"Testing message vs class","title":"Expect Chk Error — expect_chk_error","text":"checking code generates error, important check error one expect. two ways . first way simplest: just provide regexp match fragment error message. easy, fragile, test fail error message changes (even error). robust way test class error, one. can learn custom conditions https://adv-r.hadley.nz/conditions.html#custom-conditions, short, errors S3 classes can generate custom class check using class instead regexp. using expect_error() check error message formatted way makes sense human, recommend using expect_snapshot() instead.","code":""},{"path":[]},{"path":"/reference/expect_chk_error.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Expect Chk Error — expect_chk_error","text":"","code":"expect_chk_error(chk_true(FALSE)) try(expect_chk_error(chk_false(FALSE))) #> Error : `object` did not throw the expected error."},{"path":"/reference/message_chk.html","id":null,"dir":"Reference","previous_headings":"","what":"Construct Tidyverse Style Message — message_chk","title":"Construct Tidyverse Style Message — message_chk","text":"tidy = TRUE constructs tidyverse style message ","code":""},{"path":"/reference/message_chk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construct Tidyverse Style Message — message_chk","text":"","code":"message_chk(..., n = NULL, tidy = TRUE)"},{"path":"/reference/message_chk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construct Tidyverse Style Message — message_chk","text":"... Multiple objects converted string using paste0(..., collapse = ''). n value n converting sprintf-like types. tidy flag specifying whether capitalize first character add missing period.","code":""},{"path":"/reference/message_chk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Construct Tidyverse Style Message — message_chk","text":"string message.","code":""},{"path":"/reference/message_chk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Construct Tidyverse Style Message — message_chk","text":"Capitalizing first character possible. Adding trailing . missing. Also n != NULL replaces recognized sprintf-like types.","code":""},{"path":"/reference/message_chk.html","id":"sprintf-like-types","dir":"Reference","previous_headings":"","what":"sprintf-like types","title":"Construct Tidyverse Style Message — message_chk","text":"following recognized sprintf-like types can used message: n value n. s '' n == 1 otherwise 's' r '' n == 1 otherwise '' y 'y' n == 1 otherwise 'ie'","code":""},{"path":"/reference/message_chk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Construct Tidyverse Style Message — message_chk","text":"","code":"message_chk(\"there %r %n\", \" problem director%y%s\") #> [1] \"There %r %n problem director%y%s.\" message_chk(\"there %r %n\", \" problem director%y%s\", n = 1) #> [1] \"There is 1 problem directory.\" message_chk(\"There %r %n\", \" problem director%y%s.\", n = 3) #> [1] \"There are 3 problem directories.\""},{"path":"/reference/p.html","id":null,"dir":"Reference","previous_headings":"","what":"Concatenate Strings — p","title":"Concatenate Strings — p","text":"wrapper base::paste().","code":""},{"path":"/reference/p.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concatenate Strings — p","text":"","code":"p(..., sep = \" \", collapse = NULL) p0(..., collapse = NULL)"},{"path":"/reference/p.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concatenate Strings — p","text":"... one R objects, converted character vectors. sep character string separate terms. NA_character_. collapse optional character string separate results. NA_character_.","code":""},{"path":"/reference/p.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concatenate Strings — p","text":"character vector.","code":""},{"path":"/reference/p.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Concatenate Strings — p","text":"p0(): wrapper base::paste0()","code":""},{"path":"/reference/p.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Concatenate Strings — p","text":"","code":"p(\"a\", \"b\") #> [1] \"a b\" p(c(\"a\", \"b\"), collapse = \" \") #> [1] \"a b\" p0(\"a\", \"b\") #> [1] \"ab\" p0(c(\"a\", \"b\"), collapse = \"\") #> [1] \"ab\""},{"path":"/reference/params.html","id":null,"dir":"Reference","previous_headings":"","what":"Parameters for chk functions — params","title":"Parameters for chk functions — params","text":"Descriptions parameters return values chk functions","code":""},{"path":"/reference/params.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parameters for chk functions — params","text":"x object check. x_name string name object x NULL. y object check . chk flag specifying whether check parameters. chk_fun chk_ function. tolerance non-negative numeric scalar. ext character vector permitted file extensions (without .). exists flag specifying whether files/directories must (must ) exist. value non-missing scalar value. range non-missing sorted vector length 2 lower upper permitted values. inclusive flag specifying whether range exclusive. regexp string regular expression. values vector permitted values. class string specifying class. length count length. upper count max length. formals count number formal arguments. incomparables vector values compared. FALSE means values can compared. character vector specifying column names join x y . named names corresponding columns x. exclusive flag specifying whether x must include columns named values. order flag specifying whether order columns x must match names values. nrow flag whole numeric vector value, value range possible values. key character vector columns represent unique key. vld_fun vld_ function. ... Additional arguments.","code":""},{"path":"/reference/params.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parameters for chk functions — params","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/news/index.html","id":"chk-091","dir":"Changelog","previous_headings":"","what":"chk 0.9.1","title":"chk 0.9.1","text":"Merge pull request #123 poissonconsulting/b-atomic. Fixes incorrect error message chk_null_or() vld = chk::vld_xx.","code":""},{"path":"/news/index.html","id":"chk-0909000","dir":"Changelog","previous_headings":"","what":"chk 0.9.0.9000","title":"chk 0.9.0.9000","text":"previous version.","code":""},{"path":"/news/index.html","id":"chk-090","dir":"Changelog","previous_headings":"","what":"chk 0.9.0","title":"chk 0.9.0","text":"CRAN release: 2023-05-27 Added chk_compatible_lengths() vld_compatible_lengths() check lengths objects ‘strictly recyclable’. Added inclusive = TRUE argument chk_range(). Added upper argument chk_length(). vld_sorted() chk_sorted() now ignore missing values. Soft deprecated .subclass class argument err(), wrn() msg().","code":""},{"path":"/news/index.html","id":"chk-081","dir":"Changelog","previous_headings":"","what":"chk 0.8.1","title":"chk 0.8.1","text":"CRAN release: 2022-08-26 Fixed bug wherecheck_key() failing sf objects.","code":""},{"path":"/news/index.html","id":"chk-080","dir":"Changelog","previous_headings":"","what":"chk 0.8.0","title":"chk 0.8.0","text":"CRAN release: 2022-02-05 Updated deprecated argument .subclass class rlang function calls Added chk_valid_name(). Fixed chk_join() sf data frames.","code":""},{"path":"/news/index.html","id":"chk-070","dir":"Changelog","previous_headings":"","what":"chk 0.7.0","title":"chk 0.7.0","text":"CRAN release: 2021-09-03","code":""},{"path":"/news/index.html","id":"added-0-7-0","dir":"Changelog","previous_headings":"","what":"Added","title":"chk 0.7.0","text":"Added chkor_vld() faster replacement soft-deprecated chkor(). Sped chk_null_or() soft-deprecating chk argument vld argument. Un-deprecated chk_count() chk_length() useful. Updated error messages precede objects described class ‘y object class’.","code":""},{"path":"/news/index.html","id":"fixed-0-7-0","dir":"Changelog","previous_headings":"","what":"Fixed","title":"chk 0.7.0","text":"chk_null_or() now returns (invisible) x.","code":""},{"path":"/news/index.html","id":"deprecated-0-7-0","dir":"Changelog","previous_headings":"","what":"Deprecated","title":"chk 0.7.0","text":"Soft deprecated chkor() chkor_vld() slow. Soft deprecated chk argument chk_null_or() vld argument. Soft deprecated chk_chr(), chk_dbl() chk_wnum() vld_ equivalents. Warn deprecated chk_count(), chk_dirs(), chk_files(), chk_has(), chk_in(), chk_length(), chk_no_missing(), vld_no_missing(), chk_proportion() Stop deprecated chk_off(), chk_on(), is_chk_on(),","code":""},{"path":"/news/index.html","id":"chk-060","dir":"Changelog","previous_headings":"","what":"chk 0.6.0","title":"chk 0.6.0","text":"CRAN release: 2021-07-04 chk_xx() functions now return invisible copy x (passes check). Fixed bug check_key() check_data() key undefined sfobjects. chk_whole_numeric() now accepts Inf values. Removed LazyData: true DESCRIPTION file avoid CRAN check note.","code":""},{"path":"/news/index.html","id":"chk-050","dir":"Changelog","previous_headings":"","what":"chk 0.5.0","title":"chk 0.5.0","text":"CRAN release: 2020-05-29 Added chk_null_or(). Added chk_wnum() check whole numeric scalars. Added chk_dbl() check double scalars. Added chk_chr() check character scalars. Added chk_not_subset() check subset. Added chk_factor() check factor vector. Added chk_character_or_factor() factor character vector. Added check_files() check_dirs() check files directories exist (). Added chk_setordered() check order elements set. check_values() now checks factor levels. Undeprecated chk_is() useful R6 objects. Soft-deprecated chk_datetime() chk_date_time().","code":""},{"path":"/news/index.html","id":"chk-040","dir":"Changelog","previous_headings":"","what":"chk 0.4.0","title":"chk 0.4.0","text":"CRAN release: 2020-03-04 check_names(). check_dim(). check_values(). check_key(). check_data(). chk_logical() vld_logical(). chk_double() vld_double(). chk_integer() vld_integer(). chk_character() vld_character(). chk_data() vld_data(). chk_join(). chk_vector() vld_vector() ignores attributes.","code":""},{"path":"/news/index.html","id":"chk-031","dir":"Changelog","previous_headings":"","what":"chk 0.3.1","title":"chk 0.3.1","text":"CRAN release: 2020-02-05 Added expect_chk_error(). Added chk_matrix() vld_matrix(). Added chk_array() vld_array(). abort_chk now allows original arguments attached. Added chk_tz() vld_tz(). Added chk_matrix() vld_matrix(). Added chk_array() vld_array(). Added expect_chk_error().","code":""},{"path":"/news/index.html","id":"chk-030","dir":"Changelog","previous_headings":"","what":"chk 0.3.0","title":"chk 0.3.0","text":"CRAN release: 2020-01-15 Added chk_sorted() vld_sorted().","code":""},{"path":"/news/index.html","id":"chk-021","dir":"Changelog","previous_headings":"","what":"chk 0.2.1","title":"chk 0.2.1","text":"CRAN release: 2019-11-26","code":""},{"path":"/news/index.html","id":"minor-changes-0-2-1","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"chk 0.2.1","text":"Removed chk-benchmarking.Rmd vignette causing problems many CRAN checks.","code":""},{"path":"/news/index.html","id":"chk-020","dir":"Changelog","previous_headings":"","what":"chk 0.2.0","title":"chk 0.2.0","text":"CRAN release: 2019-11-15","code":""},{"path":"/news/index.html","id":"major-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Major Changes","title":"chk 0.2.0","text":"Added x_name = NULL argument relevant chk_ functions. Replaced err = FALSE variant vld_ variant. Switched stop(), warning() message() rlang variants abort(), warn() inform(). error messages now start x_name. Err capitalizes first character adds missing period (tidyverse style).","code":""},{"path":"/news/index.html","id":"new-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"New Functions","title":"chk 0.2.0","text":"chk_all() chk_atomic() chk_environment() chk_ext() chk_has() chk_not_empty() chk_s3_class() chk_s4_class() chk_setequal()","code":""},{"path":"/news/index.html","id":"newly-exported-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"Newly Exported Functions","title":"chk 0.2.0","text":"backtick_chk() unbacktick_chk().","code":""},{"path":"/news/index.html","id":"new-arguments-0-2-0","dir":"Changelog","previous_headings":"","what":"New Arguments","title":"chk 0.2.0","text":"formals argument chk_function(). tidy = TRUE argument errors, warnings messages. n = NULL call. = FALSE args error message generating functions. ellipsis = 10L argument cc(). sep = \", \" arg cc(). incomparables = FALSE argument chk_unique(). %y sprintf-like types.","code":""},{"path":"/news/index.html","id":"soft-deprecated-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"(Soft) Deprecated Functions","title":"chk 0.2.0","text":"chk_no_missing() chk_not_any_na(). chk_files() chk_dirs() chk_all(x, chk_file) etc. deparse_backtick() deparse_backtick_chk(). chk_length(), chk_proportion() chk_count(). chk_on(), chk_off() is_chk_on().","code":""},{"path":"/news/index.html","id":"minor-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"chk 0.2.0","text":"Changed chk_match() ignores missing values. Changed chk_true() (chk_false()) behavior isTRUE R >= 3.5. Extended chk_unique() handle incomparables != FALSE data frames. Changed range = c(0,1) chk_range().","code":""},{"path":"/news/index.html","id":"chk-001","dir":"Changelog","previous_headings":"","what":"chk 0.0.1","title":"chk 0.0.1","text":"Initial release.","code":""}]
+[{"path":[]},{"path":"/CODE_OF_CONDUCT.html","id":"our-pledge","dir":"","previous_headings":"","what":"Our Pledge","title":"Contributor Covenant Code of Conduct","text":"members, contributors, leaders pledge make participation community harassment-free experience everyone, regardless age, body size, visible invisible disability, ethnicity, sex characteristics, gender identity expression, level experience, education, socio-economic status, nationality, personal appearance, race, religion, sexual identity orientation. pledge act interact ways contribute open, welcoming, diverse, inclusive, healthy community.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"our-standards","dir":"","previous_headings":"","what":"Our Standards","title":"Contributor Covenant Code of Conduct","text":"Examples behavior contributes positive environment community include: Demonstrating empathy kindness toward people respectful differing opinions, viewpoints, experiences Giving gracefully accepting constructive feedback Accepting responsibility apologizing affected mistakes, learning experience Focusing best just us individuals, overall community Examples unacceptable behavior include: use sexualized language imagery, sexual attention advances kind Trolling, insulting derogatory comments, personal political attacks Public private harassment Publishing others’ private information, physical email address, without explicit permission conduct reasonably considered inappropriate professional setting","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"enforcement-responsibilities","dir":"","previous_headings":"","what":"Enforcement Responsibilities","title":"Contributor Covenant Code of Conduct","text":"Community leaders responsible clarifying enforcing standards acceptable behavior take appropriate fair corrective action response behavior deem inappropriate, threatening, offensive, harmful. Community leaders right responsibility remove, edit, reject comments, commits, code, wiki edits, issues, contributions aligned Code Conduct, communicate reasons moderation decisions appropriate.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"scope","dir":"","previous_headings":"","what":"Scope","title":"Contributor Covenant Code of Conduct","text":"Code Conduct applies within community spaces, also applies individual officially representing community public spaces. Examples representing community include using official e-mail address, posting via official social media account, acting appointed representative online offline event.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"enforcement","dir":"","previous_headings":"","what":"Enforcement","title":"Contributor Covenant Code of Conduct","text":"Instances abusive, harassing, otherwise unacceptable behavior may reported community leaders responsible enforcement [INSERT CONTACT METHOD]. complaints reviewed investigated promptly fairly. community leaders obligated respect privacy security reporter incident.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"enforcement-guidelines","dir":"","previous_headings":"","what":"Enforcement Guidelines","title":"Contributor Covenant Code of Conduct","text":"Community leaders follow Community Impact Guidelines determining consequences action deem violation Code Conduct:","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_1-correction","dir":"","previous_headings":"Enforcement Guidelines","what":"1. Correction","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Use inappropriate language behavior deemed unprofessional unwelcome community. Consequence: private, written warning community leaders, providing clarity around nature violation explanation behavior inappropriate. public apology may requested.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_2-warning","dir":"","previous_headings":"Enforcement Guidelines","what":"2. Warning","title":"Contributor Covenant Code of Conduct","text":"Community Impact: violation single incident series actions. Consequence: warning consequences continued behavior. interaction people involved, including unsolicited interaction enforcing Code Conduct, specified period time. includes avoiding interactions community spaces well external channels like social media. Violating terms may lead temporary permanent ban.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_3-temporary-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"3. Temporary Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: serious violation community standards, including sustained inappropriate behavior. Consequence: temporary ban sort interaction public communication community specified period time. public private interaction people involved, including unsolicited interaction enforcing Code Conduct, allowed period. Violating terms may lead permanent ban.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"id_4-permanent-ban","dir":"","previous_headings":"Enforcement Guidelines","what":"4. Permanent Ban","title":"Contributor Covenant Code of Conduct","text":"Community Impact: Demonstrating pattern violation community standards, including sustained inappropriate behavior, harassment individual, aggression toward disparagement classes individuals. Consequence: permanent ban sort public interaction within community.","code":""},{"path":"/CODE_OF_CONDUCT.html","id":"attribution","dir":"","previous_headings":"","what":"Attribution","title":"Contributor Covenant Code of Conduct","text":"Code Conduct adapted Contributor Covenant, version 2.0, available https://www.contributor-covenant.org/version/2/0/ code_of_conduct.html. Community Impact Guidelines inspired Mozilla’s code conduct enforcement ladder. answers common questions code conduct, see FAQ https://www.contributor-covenant.org/faq. Translations available https:// www.contributor-covenant.org/translations.","code":""},{"path":"/CONTRIBUTING.html","id":null,"dir":"","previous_headings":"","what":"Contributing to chk","title":"Contributing to chk","text":"outlines propose change chk.","code":""},{"path":"/CONTRIBUTING.html","id":"fixing-typos","dir":"","previous_headings":"","what":"Fixing typos","title":"Contributing to chk","text":"can fix typos, spelling mistakes, grammatical errors documentation directly using GitHub web interface, long changes made source file. generally means ’ll need edit roxygen2 comments .R, .Rd file. can find .R file generates .Rd reading comment first line.","code":""},{"path":"/CONTRIBUTING.html","id":"bigger-changes","dir":"","previous_headings":"","what":"Bigger changes","title":"Contributing to chk","text":"want make bigger change, ’s good idea first file issue make sure someone team agrees ’s needed. ’ve found bug, please file issue illustrates bug minimal reprex (also help write unit test, needed).","code":""},{"path":"/CONTRIBUTING.html","id":"pull-request-process","dir":"","previous_headings":"Bigger changes","what":"Pull request process","title":"Contributing to chk","text":"Fork package clone onto computer. haven’t done , recommend using usethis::create_from_github(\"\", fork = TRUE). Install development dependences devtools::install_dev_deps(), make sure package passes R CMD check running devtools::check(). R CMD check doesn’t pass cleanly, ’s good idea ask help continuing. Create Git branch pull request (PR). recommend using usethis::pr_init(\"brief-description--change\"). Make changes, commit git, create PR running usethis::pr_push(), following prompts browser. title PR briefly describe change. body PR contain Fixes #issue-number. Begin commit merge messages - indicate user facing changes included NEWS.md. use fledge automatically generate NEWS.md file.","code":""},{"path":"/CONTRIBUTING.html","id":"code-style","dir":"","previous_headings":"Bigger changes","what":"Code style","title":"Contributing to chk","text":"New code follow tidyverse style guide. can use styler package apply styles, please don’t restyle code nothing PR. use roxygen2, Markdown syntax, documentation. use testthat unit tests. Contributions test cases included easier accept.","code":""},{"path":"/CONTRIBUTING.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Contributing to chk","text":"Please note chk project released Contributor Code Conduct. contributing project agree abide terms.","code":""},{"path":"/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 Poisson Consulting Permission hereby granted, free charge, person obtaining copy software associated documentation files (“Software”), deal Software without restriction, including without limitation rights use, copy, modify, merge, publish, distribute, sublicense, /sell copies Software, permit persons Software furnished , subject following conditions: copyright notice permission notice shall included copies substantial portions Software. SOFTWARE PROVIDED “”, WITHOUT WARRANTY KIND, EXPRESS IMPLIED, INCLUDING LIMITED WARRANTIES MERCHANTABILITY, FITNESS PARTICULAR PURPOSE NONINFRINGEMENT. EVENT SHALL AUTHORS COPYRIGHT HOLDERS LIABLE CLAIM, DAMAGES LIABILITY, WHETHER ACTION CONTRACT, TORT OTHERWISE, ARISING , CONNECTION SOFTWARE USE DEALINGS SOFTWARE.","code":""},{"path":"/SUPPORT.html","id":null,"dir":"","previous_headings":"","what":"Getting help with chk","title":"Getting help with chk","text":"Thanks using chk! filing issue, places explore pieces put together make process smooth possible.","code":""},{"path":"/SUPPORT.html","id":"make-sure-its-new","dir":"","previous_headings":"","what":"Make sure its new","title":"Getting help with chk","text":"opening new issue, sure search issues pull requests make sure bug hasn’t reported /already fixed development version. default, search pre-populated :issue :open. can edit qualifiers (e.g. :pr, :closed) needed. example, ’d simply remove :open search issues repo, open closed.","code":""},{"path":"/SUPPORT.html","id":"make-a-reprex","dir":"","previous_headings":"","what":"Make a reprex","title":"Getting help with chk","text":"Start making minimal reproducible example using reprex package. haven’t heard used reprex , ’re treat! Seriously, reprex make R-question-asking endeavors easier (pretty insane ROI five ten minutes ’ll take learn ’s ). additional reprex pointers, check Get help! section tidyverse site.","code":""},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":[]},{"path":"/articles/chk-families.html","id":"check","dir":"Articles","previous_headings":"","what":"Check","title":"chk Families","text":"Functioncheck_data(x, values = NULL, exclusive = FALSE, order = FALSE, nrow = numeric(0), key = character(0)) check_dim(x, dim = length, values = numeric(0), dim_name = NULL) check_key(x, key = character(0), na_distinct = FALSE) check_names(x, names = character(0), exclusive = FALSE, order = FALSE) check_values(x, values)","code":""},{"path":"/articles/chk.html","id":"introduction","dir":"Articles","previous_headings":"","what":"Introduction","title":"Get Started with chk","text":"chk R package developers check user-supplied function arguments. designed simple, customizable fast.","code":""},{"path":"/articles/chk.html","id":"chk_-functions","dir":"Articles","previous_headings":"Introduction","what":"chk_ Functions","title":"Get Started with chk","text":"chk_ functions check properties individual objects. example chk_flag(x) checks whether x flag, .e., non-missing logical vector length 1. chk_ functions called side-effects, .e., throw informative error object fails check. Although return invisible copy first argument can used pipes. error messages, follow tidyverse style guide, designed allow user quickly identify problem argument value(s) providing. errors rlang errors subclass 'chk_error'.","code":"library(chk) y <- TRUE chk_flag(y) y <- NA chk_flag(y) #> Error: #> ! `y` must be a flag (TRUE or FALSE)."},{"path":"/articles/chk.html","id":"vld_-functions","dir":"Articles","previous_headings":"Introduction","what":"vld_ Functions","title":"Get Started with chk","text":"chk_ function matching vld_ function returns flag indicating whether object passed check. vld_ functions allow developers provide error messages.","code":"vld_flag(TRUE) #> [1] TRUE vld_flag(NA) #> [1] FALSE if (!vld_flag(NA)) abort_chk(\"`NA` is not TRUE or FALSE!!\") #> Error: #> ! `NA` is not TRUE or FALSE!!"},{"path":"/articles/chk.html","id":"using-chk","dir":"Articles","previous_headings":"","what":"Using chk","title":"Get Started with chk","text":"chk_ functions designed used within functions. Consequently, constructing error message use name object received expected name argument. case, developers can provide different name using x_name argument. IMPORTANT NOTE chk_ (vld_) functions expected directly exposed users don’t check arguments (object interest course!) ensure fast possible.","code":"fun1 <- function(x) { chk_whole_number(x) # use x } fun1(1) y <- 1.3 fun1(x = y) #> Error in `fun1()`: #> ! `x` must be a whole number (non-missing integer scalar or double equivalent). x <- NA chk_flag(x, x_name = \"`zzz`\") #> Error: #> ! `zzz` must be a flag (TRUE or FALSE)."},{"path":"/articles/chk.html","id":"extending-chk","dir":"Articles","previous_headings":"","what":"Extending chk","title":"Get Started with chk","text":"chk_flag() function illustrates general structure chk_ function. chk_ function initially checks object (using vld_ partner) object passes check immediately returns invisible copy object. , , object fails check chk_ function construct throw informative error message. deparse_backtick_chk() abort_chk() functions exported make easy programmers develop chk_ functions. chk-lgl.R script illustrates general template use developing chk_ functions.","code":"chk_flag #> function(x, x_name = NULL){ #> if(vld_flag(x)) return(invisible(x)) #> if(is.null(x_name)) x_name <- deparse_backtick_chk(substitute(x)) #> abort_chk(x_name, \" must be a flag (TRUE or FALSE)\") #> } #> #> "},{"path":"/articles/chk.html","id":"abort_chk","dir":"Articles","previous_headings":"Extending chk","what":"abort_chk()","title":"Get Started with chk","text":"abort_chk() function converts multiple arguments string using paste0(..., collapse = '') provides number sensitive sprintf-like types. default also capitalizes first character adds missing period.","code":"abort_chk(\"There %r %n problem director%y%s.\", n = 1) #> Error: #> ! There is 1 problem directory. abort_chk(\"there %r %n \", \"problem director%y%s\", n = 2) #> Error: #> ! There are 2 problem directories."},{"path":"/articles/chk.html","id":"check_-functions","dir":"Articles","previous_headings":"Extending chk","what":"check_ Functions","title":"Get Started with chk","text":"check_ functions complex chk_ functions make slower makes general tests easier.","code":""},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Joe Thorley. Author, maintainer. Kirill Müller. Author. Ayla Pearson. Author. Nadine Hussein. Contributor. Evan Amies-Galonski. Contributor. Poisson Consulting. Copyright holder, funder.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"Thorley J, Müller K, Pearson (2023). chk: Check User-Supplied Function Arguments. https://poissonconsulting.github.io/chk, https://github.com/poissonconsulting/chk.","code":"@Manual{, title = {chk: Check User-Supplied Function Arguments}, author = {Joe Thorley and Kirill Müller and Ayla Pearson}, year = {2023}, note = {https://poissonconsulting.github.io/chk, https://github.com/poissonconsulting/chk}, }"},{"path":"/index.html","id":"chk-","dir":"","previous_headings":"","what":"Check User-Supplied Function Arguments","title":"Check User-Supplied Function Arguments","text":"chk R package developers check user-supplied function arguments. designed simple, customizable fast.","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Check User-Supplied Function Arguments","text":"install latest release CRAN install latest development version GitHub","code":"install.packages(\"chk\") # install.packages(\"remotes\") remotes::install_github(\"poissonconsulting/chk\")"},{"path":"/index.html","id":"demonstration","dir":"","previous_headings":"","what":"Demonstration","title":"Check User-Supplied Function Arguments","text":"chk provides simple commonly used checks (chk_ functions) can combined together complex checking. used inside functions test user-provided arguments. Error messages follow tidyverse style guide errors rlang errors class chk_error.","code":"library(chk) y <- \"a\" chk_string(y) chk_flag(y) #> Error: #> ! `y` must be a flag (TRUE or FALSE). data <- data.frame(x = 1:2) chk_range(nrow(data), c(3, 8)) #> Error: #> ! `nrow(data)` must be between 3 and 8, not 2. my_fun <- function(x) { chk_flag(x) x } my_fun(TRUE) #> [1] TRUE my_fun(NA) #> Error in `my_fun()`: #> ! `x` must be a flag (TRUE or FALSE)."},{"path":"/index.html","id":"information","dir":"","previous_headings":"","what":"Information","title":"Check User-Supplied Function Arguments","text":"information see Get Started vignette.","code":""},{"path":"/index.html","id":"inspiration","dir":"","previous_headings":"","what":"Inspiration","title":"Check User-Supplied Function Arguments","text":"datacheckr checkr err testthat","code":""},{"path":"/index.html","id":"contribution","dir":"","previous_headings":"","what":"Contribution","title":"Check User-Supplied Function Arguments","text":"Please report issues. Pull requests always welcome.","code":""},{"path":"/index.html","id":"code-of-conduct","dir":"","previous_headings":"","what":"Code of Conduct","title":"Check User-Supplied Function Arguments","text":"Please note chk project released Contributor Code Conduct. contributing project, agree abide terms","code":""},{"path":"/pull-request.html","id":"description","dir":"","previous_headings":"","what":"Description","title":"NA","text":"Describe changes detail","code":""},{"path":"/pull-request.html","id":"related-issue","dir":"","previous_headings":"","what":"Related Issue","title":"NA","text":"pull request closes issue please include example “fix #4” just relates issue simply include example “#4”.","code":""},{"path":"/reference/aaa.html","id":null,"dir":"Reference","previous_headings":"","what":"Workaround: Avoid backtraces in examples — aaa","title":"Workaround: Avoid backtraces in examples — aaa","text":"example run first set option process builds example. (default, pkgdown builds separate process.) also produces help page linked anywhere.","code":""},{"path":"/reference/aaa.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Workaround: Avoid backtraces in examples — aaa","text":"","code":"options(rlang_backtrace_on_error = \"none\")"},{"path":"/reference/abort_chk.html","id":null,"dir":"Reference","previous_headings":"","what":"Abort Check — abort_chk","title":"Abort Check — abort_chk","text":"wrapper err() sets subclass 'chk_error'.","code":""},{"path":"/reference/abort_chk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Abort Check — abort_chk","text":"","code":"abort_chk(..., n = NULL, tidy = TRUE, call = rlang::caller_call(2))"},{"path":"/reference/abort_chk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Abort Check — abort_chk","text":"... Multiple objects converted string using paste0(..., collapse = ''). n value n converting sprintf-like types. tidy flag specifying whether capitalize first character add missing period. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"/reference/abort_chk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Abort Check — abort_chk","text":"Throws error class 'chk_error'.","code":""},{"path":"/reference/abort_chk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Abort Check — abort_chk","text":"exported allow users easily construct chk_ functions.","code":""},{"path":[]},{"path":"/reference/abort_chk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Abort Check — abort_chk","text":"","code":"try(abort_chk(\"x must be NULL\")) #> Error in eval(expr, envir, enclos) : X must be NULL. try(abort_chk(\"`x` must be NULL\")) #> Error in eval(expr, envir, enclos) : `x` must be NULL. try(abort_chk(\"there %r %n problem value%s\", n = 1)) #> Error in eval(expr, envir, enclos) : There is 1 problem value. try(abort_chk(\"there %r %n problem value%s\", n = 1.5)) #> Error in eval(expr, envir, enclos) : There are 1.5 problem values."},{"path":"/reference/cc.html","id":null,"dir":"Reference","previous_headings":"","what":"Concatenate with Commas — cc","title":"Concatenate with Commas — cc","text":"Concatenates object values string value separated comma last value separated conjunction.","code":""},{"path":"/reference/cc.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concatenate with Commas — cc","text":"","code":"cc( x, conj = \", \", sep = \", \", brac = if (is.character(x) || is.factor(x)) \"'\" else \"\", ellipsis = 10L, chk = TRUE )"},{"path":"/reference/cc.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concatenate with Commas — cc","text":"x object concatenate. conj string conjunction separate last value . sep string separator. brac string brac values . ellipsis numeric scalar maximum number values display using ellipsis. chk flag specifying whether check parameters.","code":""},{"path":"/reference/cc.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concatenate with Commas — cc","text":"string.","code":""},{"path":"/reference/cc.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Concatenate with Commas — cc","text":"default, x 10 values ellipsis used ensure 10 values displayed (including ellipsis).","code":""},{"path":"/reference/cc.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Concatenate with Commas — cc","text":"","code":"cc(1:2) #> [1] \"1, 2\" cc(1:2, conj = \" or\") #> [1] \"1 or2\" cc(3:1, brac = \"'\") #> [1] \"'3', '2', '1'\" cc(1:11) #> [1] \"1, 2, 3, 4, 5, 6, 7, 8, ..., 11\" cc(as.character(1:2)) #> [1] \"'1', '2'\""},{"path":"/reference/check_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Data — check_data","title":"Check Data — check_data","text":"Checks column names, values, number rows key data.frame.","code":""},{"path":"/reference/check_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Data — check_data","text":"","code":"check_data( x, values = NULL, exclusive = FALSE, order = FALSE, nrow = numeric(0), key = character(0), x_name = NULL )"},{"path":"/reference/check_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Data — check_data","text":"x object check. values uniquely named list atomic vectors column values. exclusive flag specifying whether x must include columns named values. order flag specifying whether order columns x must match names values. nrow flag whole numeric vector value, value range possible values. key character vector columns represent unique key. x_name string name object x NULL.","code":""},{"path":"/reference/check_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Data — check_data","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Data — check_data","text":"","code":"check_data(data.frame()) check_data(data.frame(x = 2), list(x = 1)) try(check_data(data.frame(x = 2), list(y = 1L))) #> Error in check_data(data.frame(x = 2), list(y = 1L)) : #> `names(data.frame(x = 2))` must include 'y'. try(check_data(data.frame(x = 2), list(y = 1))) #> Error in check_data(data.frame(x = 2), list(y = 1)) : #> `names(data.frame(x = 2))` must include 'y'. try(check_data(data.frame(x = 2), nrow = 2)) #> Error in check_dim(x, dim = base::nrow, values = nrow, x_name = x_name, : #> `nrow(`data.frame(x = 2)`)` must be equal to 2. #> Use `rlang::last_error()$y` to show the object compared to."},{"path":"/reference/check_dim.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Dimension — check_dim","title":"Check Dimension — check_dim","text":"Checks dimension object.","code":""},{"path":"/reference/check_dim.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Dimension — check_dim","text":"","code":"check_dim(x, dim = length, values = numeric(0), x_name = NULL, dim_name = NULL)"},{"path":"/reference/check_dim.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Dimension — check_dim","text":"x object check. dim function returning non-negative whole number dimension. values flag whole numeric vector value, value range possible values. x_name string name object x NULL. dim_name string name dim function.","code":""},{"path":"/reference/check_dim.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Dimension — check_dim","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_dim.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Dimension — check_dim","text":"","code":"check_dim(1) try(check_dim(1, values = FALSE)) #> Error in check_dim(1, values = FALSE) : `length(1)` must be equal to 0L. #> Use `rlang::last_error()$y` to show the object compared to. try(check_dim(1, values = c(10, 2))) #> Error in check_dim(1, values = c(10, 2)) : #> `length(1)` must be between 2 and 10, not 1. try(check_dim(data.frame(x = 1), dim = nrow, values = c(10, 10, 2))) #> Error in check_dim(data.frame(x = 1), dim = nrow, values = c(10, 10, 2)) : #> `nrow(data.frame(x = 1))` must match 2 or 10, not 1."},{"path":"/reference/check_dirs.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Directories Exist — check_dirs","title":"Check Directories Exist — check_dirs","text":"Checks directories exist (exists = FALSE exist directories files).","code":""},{"path":"/reference/check_dirs.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Directories Exist — check_dirs","text":"","code":"check_dirs(x, exists = TRUE, x_name = NULL)"},{"path":"/reference/check_dirs.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Directories Exist — check_dirs","text":"x object check. exists flag specifying whether files/directories must (must ) exist. x_name string name object x NULL.","code":""},{"path":"/reference/check_dirs.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Directories Exist — check_dirs","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_dirs.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Directories Exist — check_dirs","text":"","code":"check_dirs(tempdir()) try(check_dirs(tempdir(), exists = FALSE)) #> Error in eval(expr, envir, enclos) : #> `tempdir()` must not specify existing directories ('/tmp/RtmpCk3GLQ' exists)."},{"path":"/reference/check_files.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Files Exist — check_files","title":"Check Files Exist — check_files","text":"Checks files exist (exists = FALSE exist files directories).","code":""},{"path":"/reference/check_files.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Files Exist — check_files","text":"","code":"check_files(x, exists = TRUE, x_name = NULL)"},{"path":"/reference/check_files.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Files Exist — check_files","text":"x object check. exists flag specifying whether files/directories must (must ) exist. x_name string name object x NULL.","code":""},{"path":"/reference/check_files.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Files Exist — check_files","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_files.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Files Exist — check_files","text":"","code":"check_files(tempfile(\"unlikely-that-exists-chk\"), exists = FALSE) try(check_files(tempfile(\"unlikely-that-exists-chk\"))) #> Error in eval(expr, envir, enclos) : #> `tempfile(\"unlikely-that-exists-chk\")` must specify existing files ('/tmp/RtmpCk3GLQ/unlikely-that-exists-chk181b35faf90d' can't be found)."},{"path":"/reference/check_key.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Key — check_key","title":"Check Key — check_key","text":"Checks columns unique rows.","code":""},{"path":"/reference/check_key.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Key — check_key","text":"","code":"check_key(x, key = character(0), na_distinct = FALSE, x_name = NULL)"},{"path":"/reference/check_key.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Key — check_key","text":"x object check. key character vector columns represent unique key. na_distinct flag specifying whether missing values considered distinct. x_name string name object x NULL.","code":""},{"path":"/reference/check_key.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Key — check_key","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_key.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Key — check_key","text":"","code":"x <- data.frame(x = c(1, 2), y = c(1, 1)) check_key(x) try(check_key(x, \"y\")) #> Error in eval(expr, envir, enclos) : #> Column 'y' in `x` must be a unique key."},{"path":"/reference/check_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Names — check_names","title":"Check Names — check_names","text":"Checks names object.","code":""},{"path":"/reference/check_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Names — check_names","text":"","code":"check_names( x, names = character(0), exclusive = FALSE, order = FALSE, x_name = NULL )"},{"path":"/reference/check_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Names — check_names","text":"x object check. names character vector required names. exclusive flag specifying whether x must contain required names. order flag specifying whether order required names x must match order names. x_name string name object x NULL.","code":""},{"path":"/reference/check_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Names — check_names","text":"informative error test fails invisible copy x.","code":""},{"path":[]},{"path":"/reference/check_names.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Names — check_names","text":"","code":"x <- c(x = 1, y = 2) check_names(x, c(\"y\", \"x\")) try(check_names(x, c(\"y\", \"x\"), order = TRUE)) #> Error in eval(expr, envir, enclos) : #> `names(x)` must include 'y' and 'x' in that order. try(check_names(x, \"x\", exclusive = TRUE)) #> Error in eval(expr, envir, enclos) : `names(x)` must not include 'y'."},{"path":"/reference/check_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Values and Class — check_values","title":"Check Values and Class — check_values","text":"Checks values S3 class atomic object.","code":""},{"path":"/reference/check_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Values and Class — check_values","text":"","code":"check_values(x, values, x_name = NULL)"},{"path":"/reference/check_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Values and Class — check_values","text":"x object check. values atomic vector specifying S3 class possible values. x_name string name object x NULL.","code":""},{"path":"/reference/check_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Values and Class — check_values","text":"informative error test fails invisible copy x.","code":""},{"path":"/reference/check_values.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Values and Class — check_values","text":"check class simply pass vector desired class. check x include missing values pass single non-missing value (correct class). allow include missing values include missing value. check includes missing values pass missing value (correct class). check range values x pass two non-missing values (well missing value required). check x includes specific values pass three non-missing values. case factor ensure values two levels check levels x ordered superset levels value three levels check identical.","code":""},{"path":[]},{"path":"/reference/check_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Values and Class — check_values","text":"","code":"check_values(1, numeric(0)) check_values(1, 2) try(check_values(1, 1L)) #> Error in check_values(1, 1L) : `1` must inherit from S3 class 'integer'. try(check_values(NA_real_, 1)) #> Error in check_values(NA_real_, 1) : #> `NA_real_` must not have any missing values."},{"path":"/reference/chk-package.html","id":null,"dir":"Reference","previous_headings":"","what":"chk: Check User-Supplied Function Arguments — chk-package","title":"chk: Check User-Supplied Function Arguments — chk-package","text":"developers check user-supplied function arguments. designed simple, fast customizable. Error messages follow tidyverse style guide.","code":""},{"path":[]},{"path":"/reference/chk-package.html","id":"author","dir":"Reference","previous_headings":"","what":"Author","title":"chk: Check User-Supplied Function Arguments — chk-package","text":"Maintainer: Joe Thorley joe@poissonconsulting.ca (ORCID) Authors: Kirill Müller (ORCID) Ayla Pearson (ORCID) contributors: Nadine Hussein nadine@poissonconsulting.ca (ORCID) [contributor] Evan Amies-Galonski evan@poissonconsulting.ca (ORCID) [contributor] Poisson Consulting [copyright holder, funder]","code":""},{"path":"/reference/chk_all.html","id":null,"dir":"Reference","previous_headings":"","what":"Check All — chk_all","title":"Check All — chk_all","text":"Checks elements using (vapply(x, chk_fun, TRUE, ...))","code":""},{"path":"/reference/chk_all.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check All — chk_all","text":"","code":"chk_all(x, chk_fun, ..., x_name = NULL) vld_all(x, vld_fun, ...)"},{"path":"/reference/chk_all.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check All — chk_all","text":"x object check. chk_fun chk_ function. ... Additional arguments. x_name string name object x NULL. vld_fun vld_ function.","code":""},{"path":"/reference/chk_all.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check All — chk_all","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_all.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check All — chk_all","text":"vld_all(): Validate ","code":""},{"path":[]},{"path":"/reference/chk_all.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check All — chk_all","text":"","code":"# chk_all chk_all(TRUE, chk_lgl) # FIXME try(chk_all(1, chk_lgl)) chk_all(c(TRUE, NA), chk_lgl) # vld_all vld_all(c(TRUE, NA), vld_lgl) #> [1] TRUE"},{"path":"/reference/chk_all_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check All Equal — chk_all_equal","title":"Check All Equal — chk_all_equal","text":"Checks elements x equal using length(x) < 2L || (vapply(x, vld_equal, TRUE, y = x[[1]], tolerance = tolerance))","code":""},{"path":"/reference/chk_all_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check All Equal — chk_all_equal","text":"","code":"chk_all_equal(x, tolerance = sqrt(.Machine$double.eps), x_name = NULL) vld_all_equal(x, tolerance = sqrt(.Machine$double.eps))"},{"path":"/reference/chk_all_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check All Equal — chk_all_equal","text":"x object check. tolerance non-negative numeric scalar. x_name string name object x NULL.","code":""},{"path":"/reference/chk_all_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check All Equal — chk_all_equal","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_all_equal.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check All Equal — chk_all_equal","text":"vld_all_equal(): Validate Equal","code":""},{"path":[]},{"path":"/reference/chk_all_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check All Equal — chk_all_equal","text":"","code":"# chk_all_equal chk_all_equal(c(1, 1.00000001)) try(chk_all_equal(c(1, 1.0000001))) #> Error in eval(expr, envir, enclos) : #> `c(1, 1.0000001)` must have equal elements. chk_all_equal(list(c(x = 1), c(x = 1))) try(chk_all_equal(list(c(x = 1), c(y = 1)))) #> Error in eval(expr, envir, enclos) : #> `list(c(x = 1), c(y = 1))` must have equal elements. # vld_all_equal vld_all_equal(c(1, 1L)) #> [1] TRUE"},{"path":"/reference/chk_all_equivalent.html","id":null,"dir":"Reference","previous_headings":"","what":"Check All Equivalent — chk_all_equivalent","title":"Check All Equivalent — chk_all_equivalent","text":"Checks elements x equivalent using length(x) < 2L || (vapply(x, vld_equivalent, TRUE, y = x[[1]], tolerance = tolerance))","code":""},{"path":"/reference/chk_all_equivalent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check All Equivalent — chk_all_equivalent","text":"","code":"chk_all_equivalent(x, tolerance = sqrt(.Machine$double.eps), x_name = NULL) vld_all_equivalent(x, tolerance = sqrt(.Machine$double.eps))"},{"path":"/reference/chk_all_equivalent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check All Equivalent — chk_all_equivalent","text":"x object check. tolerance non-negative numeric scalar. x_name string name object x NULL.","code":""},{"path":"/reference/chk_all_equivalent.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check All Equivalent — chk_all_equivalent","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_all_equivalent.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check All Equivalent — chk_all_equivalent","text":"vld_all_equivalent(): Validate Equivalent","code":""},{"path":[]},{"path":"/reference/chk_all_equivalent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check All Equivalent — chk_all_equivalent","text":"","code":"# chk_all_equivalent chk_all_equivalent(c(1, 1.00000001)) try(chk_all_equivalent(c(1, 1.0000001))) #> Error in eval(expr, envir, enclos) : #> `c(1, 1.0000001)` must have equivalent elements. chk_all_equivalent(list(c(x = 1), c(x = 1))) chk_all_equivalent(list(c(x = 1), c(y = 1))) # vld_all_equivalent vld_all_equivalent(c(x = 1, y = 1)) #> [1] TRUE"},{"path":"/reference/chk_all_identical.html","id":null,"dir":"Reference","previous_headings":"","what":"Check All Identical — chk_all_identical","title":"Check All Identical — chk_all_identical","text":"Checks elements x identical using length(x) < 2L || (vapply(x, vld_identical, TRUE, y = x[[1]])) Pass: c(1, 1, 1), list(1, 1) Fail: c(1, 1.0000001), list(1, NA)","code":""},{"path":"/reference/chk_all_identical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check All Identical — chk_all_identical","text":"","code":"chk_all_identical(x, x_name = NULL) vld_all_identical(x)"},{"path":"/reference/chk_all_identical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check All Identical — chk_all_identical","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_all_identical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check All Identical — chk_all_identical","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_all_identical.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check All Identical — chk_all_identical","text":"vld_all_identical(): Validate Identical","code":""},{"path":[]},{"path":"/reference/chk_all_identical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check All Identical — chk_all_identical","text":"","code":"# chk_all_identical chk_all_identical(c(1, 1)) try(chk_all_identical(c(1, 1.1))) #> Error in eval(expr, envir, enclos) : #> `c(1, 1.1)` must have identical elements. # vld_all_identical vld_all_identical(c(1, 1)) #> [1] TRUE"},{"path":"/reference/chk_array.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Array — chk_array","title":"Check Array — chk_array","text":"Checks array using .array(x)","code":""},{"path":"/reference/chk_array.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Array — chk_array","text":"","code":"chk_array(x, x_name = NULL) vld_array(x)"},{"path":"/reference/chk_array.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Array — chk_array","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_array.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Array — chk_array","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_array.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Array — chk_array","text":"vld_array(): Validate Array","code":""},{"path":[]},{"path":"/reference/chk_array.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Array — chk_array","text":"","code":"# chk_array chk_array(array(1)) try(chk_array(matrix(1))) # vld_array vld_array(1) #> [1] FALSE vld_array(array(1)) #> [1] TRUE"},{"path":"/reference/chk_atomic.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Atomic — chk_atomic","title":"Check Atomic — chk_atomic","text":"Checks atomic using .atomic(x)","code":""},{"path":"/reference/chk_atomic.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Atomic — chk_atomic","text":"","code":"chk_atomic(x, x_name = NULL) vld_atomic(x)"},{"path":"/reference/chk_atomic.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Atomic — chk_atomic","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_atomic.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Atomic — chk_atomic","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_atomic.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Atomic — chk_atomic","text":"vld_atomic(): Validate Atomic","code":""},{"path":[]},{"path":"/reference/chk_atomic.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Atomic — chk_atomic","text":"","code":"# chk_atomic chk_atomic(1) try(chk_atomic(list(1))) #> Error in eval(expr, envir, enclos) : `list(1)` must be atomic. # vld_atomic vld_atomic(1) #> [1] TRUE vld_atomic(matrix(1:3)) #> [1] TRUE vld_atomic(character(0)) #> [1] TRUE vld_atomic(list(1)) #> [1] FALSE vld_atomic(NULL) #> [1] TRUE"},{"path":"/reference/chk_character.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Character — chk_character","title":"Check Character — chk_character","text":"Checks character using .character(x)","code":""},{"path":"/reference/chk_character.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Character — chk_character","text":"","code":"chk_character(x, x_name = NULL) vld_character(x)"},{"path":"/reference/chk_character.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Character — chk_character","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_character.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Character — chk_character","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_character.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Character — chk_character","text":"vld_character(): Validate Character","code":""},{"path":[]},{"path":"/reference/chk_character.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Character — chk_character","text":"","code":"# chk_character chk_character(\"1\") try(chk_character(1)) #> Error in eval(expr, envir, enclos) : `1` must be character. # vld_character vld_character(\"1\") #> [1] TRUE vld_character(matrix(\"a\")) #> [1] TRUE vld_character(character(0)) #> [1] TRUE vld_character(NA_character_) #> [1] TRUE vld_character(1) #> [1] FALSE vld_character(TRUE) #> [1] FALSE vld_character(factor(\"text\")) #> [1] FALSE"},{"path":"/reference/chk_character_or_factor.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Character or Factor — chk_character_or_factor","title":"Check Character or Factor — chk_character_or_factor","text":"Checks character factor using .character(x) || .factor(x)","code":""},{"path":"/reference/chk_character_or_factor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Character or Factor — chk_character_or_factor","text":"","code":"chk_character_or_factor(x, x_name = NULL) vld_character_or_factor(x)"},{"path":"/reference/chk_character_or_factor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Character or Factor — chk_character_or_factor","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_character_or_factor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Character or Factor — chk_character_or_factor","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_character_or_factor.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Character or Factor — chk_character_or_factor","text":"vld_character_or_factor(): Validate Character Factor","code":""},{"path":[]},{"path":"/reference/chk_character_or_factor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Character or Factor — chk_character_or_factor","text":"","code":"# chk_character_or_factor chk_character_or_factor(\"1\") chk_character_or_factor(factor(\"1\")) try(chk_character(1)) #> Error in eval(expr, envir, enclos) : `1` must be character. # vld_character_or_factor vld_character_or_factor(\"1\") #> [1] TRUE vld_character_or_factor(matrix(\"a\")) #> [1] TRUE vld_character_or_factor(character(0)) #> [1] TRUE vld_character_or_factor(NA_character_) #> [1] TRUE vld_character_or_factor(1) #> [1] FALSE vld_character_or_factor(TRUE) #> [1] FALSE vld_character_or_factor(factor(\"text\")) #> [1] TRUE"},{"path":"/reference/chk_chr.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Character Scalar — chk_chr","title":"Check Character Scalar — chk_chr","text":"Checks character scalar using .character(x) && length(x) == 1L","code":""},{"path":"/reference/chk_chr.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Character Scalar — chk_chr","text":"","code":"chk_chr(x, x_name = NULL) vld_chr(x)"},{"path":"/reference/chk_chr.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Character Scalar — chk_chr","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_chr.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Character Scalar — chk_chr","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_chr.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Character Scalar — chk_chr","text":"vld_chr(): Validate Character Scalar","code":""},{"path":[]},{"path":"/reference/chk_chr.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Character Scalar — chk_chr","text":"","code":"chk_chr(\"a\") try(chk_chr(1)) #> Warning: `chk_chr()` was deprecated in chk 0.6.1. #> ℹ Please use `chk::chk_scalar(x);` `chk::chk_character(x)` instead #> Error in eval(expr, envir, enclos) : `1` must be a character scalar. # vld_chr vld_chr(\"\") #> [1] TRUE vld_chr(\"a\") #> [1] TRUE vld_chr(NA_character_) #> [1] TRUE vld_chr(c(\"a\", \"b\")) #> [1] FALSE vld_chr(1) #> [1] FALSE"},{"path":"/reference/chk_compatible_lengths.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Compatible Lengths — chk_compatible_lengths","title":"Check Compatible Lengths — chk_compatible_lengths","text":"Checks objects (including vectors) lengths 'strictly recycled'. say must either zero length length length 1.","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Compatible Lengths — chk_compatible_lengths","text":"","code":"chk_compatible_lengths(..., x_name = NULL) vld_compatible_lengths(...)"},{"path":"/reference/chk_compatible_lengths.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Compatible Lengths — chk_compatible_lengths","text":"... objects check compatible lengths. x_name string name object x NULL.","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Compatible Lengths — chk_compatible_lengths","text":"chk_ function throws informative error test fails.","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Compatible Lengths — chk_compatible_lengths","text":"function helps check vectors 'strictly recycled.' example function error vector length 2 length 4, even though vector length 2 'loosely recycled' match vector length 4 combined. intent function check strict recycling occurring.","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Compatible Lengths — chk_compatible_lengths","text":"vld_compatible_lengths(): Validate Compatible Lengths","code":""},{"path":"/reference/chk_compatible_lengths.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Compatible Lengths — chk_compatible_lengths","text":"","code":"# chk_compatible_lengths a <- integer(0) b <- numeric(0) chk_compatible_lengths(a, b) a <- 1 b <- 2 chk_compatible_lengths(a, b) a <- 1:3 b <- 1:3 chk_compatible_lengths(a, b) b <- 1 chk_compatible_lengths(a, b) b <- 1:2 try(chk_compatible_lengths(a, b)) #> Error in eval(expr, envir, enclos) : #> ... objects must be all zero length or the same length with some of length of 1 but not lengths 2 and 3. b <- 1:6 try(chk_compatible_lengths(a, b)) #> Error in eval(expr, envir, enclos) : #> ... objects must be all zero length or the same length with some of length of 1 but not lengths 3 and 6. # vld_compatible_lengths a <- integer(0) b <- numeric(0) vld_compatible_lengths(a, b) #> [1] TRUE a <- 1 b <- 2 vld_compatible_lengths(a, b) #> [1] TRUE a <- 1:3 b <- 1:3 vld_compatible_lengths(a, b) #> [1] TRUE b <- 1 vld_compatible_lengths(a, b) #> [1] TRUE b <- 1:2 vld_compatible_lengths(a, b) #> [1] FALSE b <- 1:6 vld_compatible_lengths(a, b) #> [1] FALSE"},{"path":"/reference/chk_count.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Count — chk_count","title":"Check Count — chk_count","text":"Checks non-negative whole number using vld_whole_number(x) && x >= 0","code":""},{"path":"/reference/chk_count.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Count — chk_count","text":"","code":"chk_count(x, x_name = NULL) vld_count(x)"},{"path":"/reference/chk_count.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Count — chk_count","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_count.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Count — chk_count","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_count.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Count — chk_count","text":"vld_count(): Validate Count","code":""},{"path":[]},{"path":"/reference/chk_count.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Count — chk_count","text":"","code":"# chk_count chk_count(1) try(chk_count(1.5)) #> Error in eval(expr, envir, enclos) : #> `1.5` must be a count (non-negative non-missing integer scalar or double equivalent). # vld_count vld_count(1) #> [1] TRUE vld_count(0L) #> [1] TRUE vld_count(-1) #> [1] FALSE vld_count(0.5) #> [1] FALSE"},{"path":"/reference/chk_data.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Data — chk_data","title":"Check Data — chk_data","text":"Checks data.frame using inherits(x, \"data.frame\")","code":""},{"path":"/reference/chk_data.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Data — chk_data","text":"","code":"chk_data(x, x_name = NULL) vld_data(x)"},{"path":"/reference/chk_data.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Data — chk_data","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_data.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Data — chk_data","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_data.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Data — chk_data","text":"vld_data(): Validate Data","code":""},{"path":[]},{"path":"/reference/chk_data.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Data — chk_data","text":"","code":"# chk_data chk_data(data.frame(x = 1)) try(chk_data(1)) #> Error in eval(expr, envir, enclos) : `1` must be a data.frame. # vld_data vld_data(data.frame()) #> [1] TRUE vld_data(data.frame(x = 1)) #> [1] TRUE vld_data(c(x = 1)) #> [1] FALSE"},{"path":"/reference/chk_date.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Date — chk_date","title":"Check Date — chk_date","text":"Checks non-missing Date scalar using inherits(x, \"Date\") && length(x) == 1L && !anyNA(x)","code":""},{"path":"/reference/chk_date.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Date — chk_date","text":"","code":"chk_date(x, x_name = NULL) vld_date(x)"},{"path":"/reference/chk_date.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Date — chk_date","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_date.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Date — chk_date","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_date.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Date — chk_date","text":"vld_date(): Validate Date","code":""},{"path":[]},{"path":"/reference/chk_date.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Date — chk_date","text":"","code":"# chk_date chk_date(Sys.Date()) try(chk_date(1)) #> Error in eval(expr, envir, enclos) : #> `1` must be a date (non-missing Date scalar). # vld_date vld_date(Sys.Date()) #> [1] TRUE vld_date(Sys.time()) #> [1] FALSE vld_date(1) #> [1] FALSE"},{"path":"/reference/chk_date_time.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Date Time — chk_date_time","title":"Check Date Time — chk_date_time","text":"Checks non-missing POSIXct scalar using inherits(x, \"POSIXct\") && length(x) == 1L && !anyNA(x)","code":""},{"path":"/reference/chk_date_time.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Date Time — chk_date_time","text":"","code":"chk_date_time(x, x_name = NULL) chk_datetime(x, x_name = NULL) vld_date_time(x) vld_datetime(x)"},{"path":"/reference/chk_date_time.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Date Time — chk_date_time","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_date_time.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Date Time — chk_date_time","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_date_time.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Date Time — chk_date_time","text":"chk_datetime(): Check Date Time (Deprecated) vld_date_time(): Validate Date Time vld_datetime(): Validate Date Time (Deprecated)","code":""},{"path":[]},{"path":"/reference/chk_date_time.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Date Time — chk_date_time","text":"","code":"# chk_date_time chk_date_time(as.POSIXct(\"2001-01-02\")) try(chk_date_time(1)) #> Error in eval(expr, envir, enclos) : #> `1` must be a date time (non-missing POSIXct scalar). # vld_date_time vld_date_time(as.POSIXct(\"2001-01-02\")) #> [1] TRUE vld_date_time(Sys.time()) #> [1] TRUE vld_date_time(1) #> [1] FALSE vld_date_time(\"2001-01-02\") #> [1] FALSE vld_date_time(c(Sys.time(), Sys.time())) #> [1] FALSE"},{"path":"/reference/chk_dbl.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Double Scalar — chk_dbl","title":"Check Double Scalar — chk_dbl","text":"Checks double scalar using .double(x) && length(x) == 1L","code":""},{"path":"/reference/chk_dbl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Double Scalar — chk_dbl","text":"","code":"chk_dbl(x, x_name = NULL) vld_dbl(x)"},{"path":"/reference/chk_dbl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Double Scalar — chk_dbl","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_dbl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Double Scalar — chk_dbl","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_dbl.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Double Scalar — chk_dbl","text":"vld_dbl(): Validate Double","code":""},{"path":[]},{"path":"/reference/chk_dbl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Double Scalar — chk_dbl","text":"","code":"# chk_dbl chk_dbl(1) try(chk_dbl(1L)) #> Warning: `chk_dbl()` was deprecated in chk 0.6.1. #> ℹ Please use `chk::chk_scalar(x);` `chk::chk_double(x)` instead #> Error in eval(expr, envir, enclos) : `1L` must be double (real) scalar. # vld_dbl vld_dbl(1) #> [1] TRUE vld_dbl(double(0)) #> [1] FALSE vld_dbl(NA_real_) #> [1] TRUE vld_dbl(c(1, 1)) #> [1] FALSE vld_dbl(1L) #> [1] FALSE"},{"path":"/reference/chk_deprecated.html","id":null,"dir":"Reference","previous_headings":"","what":"Deprecated functions — chk_deprecated","title":"Deprecated functions — chk_deprecated","text":"Deprecated chk_() functions.","code":""},{"path":"/reference/chk_deprecated.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deprecated functions — chk_deprecated","text":"","code":"chk_dirs(x) chk_files(x) chk_has(x, values, x_name = NULL) chk_in(x, values, x_name = NULL) chk_no_missing(x, x_name = NULL) vld_no_missing(x) chk_off() chk_on() is_chk_on() chk_proportion(x, x_name = NULL) deparse_backtick(x)"},{"path":"/reference/chk_deprecated.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deprecated functions — chk_deprecated","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_deprecated.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Deprecated functions — chk_deprecated","text":"chk_dirs(): Check Directories Exist Replace [chk_all](x, [chk_dir]) chk_files(): Check Files Exist Replace [chk_all](x, [chk_file]) chk_has(): Check Replace chk_superset() chk_in(): Check Replace chk_subset() chk_no_missing(): Check Missing Values Replace chk_not_any_na() vld_no_missing(): Validate Missing Values Replace vld_not_any_na() chk_off(): Turns checking approach longer recommended chk_on(): Turns checking approach longer recommended is_chk_on(): Tests checking approach longer recommended chk_proportion(): Check Proportion Replace [chk_number](x); [chk_range](x) deparse_backtick(): Deparse Backtick Replace deparse_backtick_chk()","code":""},{"path":[]},{"path":"/reference/chk_dir.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Directory Exists — chk_dir","title":"Check Directory Exists — chk_dir","text":"Checks directory exists using vld_string(x) && dir.exists(x)","code":""},{"path":"/reference/chk_dir.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Directory Exists — chk_dir","text":"","code":"chk_dir(x, x_name = NULL) vld_dir(x)"},{"path":"/reference/chk_dir.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Directory Exists — chk_dir","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_dir.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Directory Exists — chk_dir","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_dir.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Directory Exists — chk_dir","text":"vld_dir(): Validate Directory Exists","code":""},{"path":[]},{"path":"/reference/chk_dir.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Directory Exists — chk_dir","text":"","code":"# chk_dir chk_dir(tempdir()) try(chk_dir(tempfile())) #> Error in eval(expr, envir, enclos) : #> `tempfile()` must specify an existing directory ('/tmp/RtmpCk3GLQ/file181bdb9ae6c' can't be found). # vld_dir vld_dir(1) #> [1] FALSE vld_dir(tempdir()) #> [1] TRUE vld_dir(tempfile()) #> [1] FALSE"},{"path":"/reference/chk_double.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Double — chk_double","title":"Check Double — chk_double","text":"Checks double using .double(x)","code":""},{"path":"/reference/chk_double.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Double — chk_double","text":"","code":"chk_double(x, x_name = NULL) vld_double(x)"},{"path":"/reference/chk_double.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Double — chk_double","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_double.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Double — chk_double","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_double.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Double — chk_double","text":"vld_double(): Validate Double","code":""},{"path":[]},{"path":"/reference/chk_double.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Double — chk_double","text":"","code":"# chk_double chk_double(1) try(chk_double(1L)) #> Error in eval(expr, envir, enclos) : `1L` must be double. # vld_double vld_double(1) #> [1] TRUE vld_double(matrix(c(1, 2, 3, 4), nrow = 2L)) #> [1] TRUE vld_double(double(0)) #> [1] TRUE vld_double(numeric(0)) #> [1] TRUE vld_double(NA_real_) #> [1] TRUE vld_double(1L) #> [1] FALSE vld_double(TRUE) #> [1] FALSE"},{"path":"/reference/chk_environment.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Environment — chk_environment","title":"Check Environment — chk_environment","text":"Checks environment using .environment(x)","code":""},{"path":"/reference/chk_environment.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Environment — chk_environment","text":"","code":"chk_environment(x, x_name = NULL) vld_environment(x)"},{"path":"/reference/chk_environment.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Environment — chk_environment","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_environment.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Environment — chk_environment","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_environment.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Environment — chk_environment","text":"vld_environment(): Validate Environment","code":""},{"path":[]},{"path":"/reference/chk_environment.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Environment — chk_environment","text":"","code":"# chk_environment chk_environment(.GlobalEnv) try(chk_environment(1)) #> Error in eval(expr, envir, enclos) : `1` must be an environment. # vld_environment vld_environment(1) #> [1] FALSE vld_environment(list(1)) #> [1] FALSE vld_environment(.GlobalEnv) #> [1] TRUE vld_environment(environment()) #> [1] TRUE"},{"path":"/reference/chk_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Equal — chk_equal","title":"Check Equal — chk_equal","text":"Checks equal (identical within tolerance) y using vld_true(.equal(x, y, tolerance))","code":""},{"path":"/reference/chk_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Equal — chk_equal","text":"","code":"chk_equal(x, y, tolerance = sqrt(.Machine$double.eps), x_name = NULL) vld_equal(x, y, tolerance = sqrt(.Machine$double.eps))"},{"path":"/reference/chk_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Equal — chk_equal","text":"x object check. y object check . tolerance non-negative numeric scalar. x_name string name object x NULL.","code":""},{"path":"/reference/chk_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Equal — chk_equal","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_equal.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Equal — chk_equal","text":"vld_equal(): Validate Equal","code":""},{"path":[]},{"path":"/reference/chk_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Equal — chk_equal","text":"","code":"# chk_equal chk_equal(1, 1.00000001) try(chk_equal(1, 1.0000001)) #> Error in eval(expr, envir, enclos) : `1` must be equal to 1.0000001. #> Use `rlang::last_error()$y` to show the object compared to. chk_equal(1, 1L) chk_equal(c(x = 1), c(x = 1L)) try(chk_equal(c(x = 1), c(y = 1L))) #> Error in eval(expr, envir, enclos) : #> `c(x = 1)` must be equal to c(y = 1L). #> Use `rlang::last_error()$y` to show the object compared to. vld_equal(1, 1.00000001) #> [1] TRUE"},{"path":"/reference/chk_equivalent.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Equivalent — chk_equivalent","title":"Check Equivalent — chk_equivalent","text":"Checks equivalent (equal ignoring attributes) y using vld_true(.equal(x, y, tolerance, check.attributes = FALSE))","code":""},{"path":"/reference/chk_equivalent.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Equivalent — chk_equivalent","text":"","code":"chk_equivalent(x, y, tolerance = sqrt(.Machine$double.eps), x_name = NULL) vld_equivalent(x, y, tolerance = sqrt(.Machine$double.eps))"},{"path":"/reference/chk_equivalent.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Equivalent — chk_equivalent","text":"x object check. y object check . tolerance non-negative numeric scalar. x_name string name object x NULL.","code":""},{"path":"/reference/chk_equivalent.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Equivalent — chk_equivalent","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_equivalent.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Equivalent — chk_equivalent","text":"vld_equivalent(): Validate Equivalent","code":""},{"path":[]},{"path":"/reference/chk_equivalent.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Equivalent — chk_equivalent","text":"","code":"# chk_equivalent chk_equivalent(1, 1.00000001) try(chk_equivalent(1, 1.0000001)) #> Error in eval(expr, envir, enclos) : `1` must be equivalent to 1.0000001. #> Use `rlang::last_error()$y` to show the object compared to. chk_equivalent(1, 1L) chk_equivalent(c(x = 1), c(y = 1)) vld_equivalent(c(x = 1), c(y = 1L)) #> [1] TRUE"},{"path":"/reference/chk_ext.html","id":null,"dir":"Reference","previous_headings":"","what":"Check File Extension — chk_ext","title":"Check File Extension — chk_ext","text":"Checks extension using vld_string(x) && vld_subset(tools::file_ext(x), ext) user may want use toupper() tolower() ensure case matches.","code":""},{"path":"/reference/chk_ext.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check File Extension — chk_ext","text":"","code":"chk_ext(x, ext, x_name = NULL) vld_ext(x, ext)"},{"path":"/reference/chk_ext.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check File Extension — chk_ext","text":"x object check. ext character vector permitted file extensions (without .). x_name string name object x NULL.","code":""},{"path":"/reference/chk_ext.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check File Extension — chk_ext","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_ext.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check File Extension — chk_ext","text":"vld_ext(): Validate File Extension","code":""},{"path":[]},{"path":"/reference/chk_ext.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check File Extension — chk_ext","text":"","code":"# chk_ext try(chk_ext(\"file1.pdf\", \"png\")) #> Error in eval(expr, envir, enclos) : #> `\"file1.pdf\"` must have extension 'png' (not 'pdf'). # vld_ext vld_ext(\"oeu.pdf\", \"pdf\") #> [1] TRUE vld_ext(toupper(\"oeu.pdf\"), \"PDF\") #> [1] TRUE"},{"path":"/reference/chk_factor.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Factor — chk_factor","title":"Check Factor — chk_factor","text":"Checks factor using .factor(x)","code":""},{"path":"/reference/chk_factor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Factor — chk_factor","text":"","code":"chk_factor(x, x_name = NULL) vld_factor(x)"},{"path":"/reference/chk_factor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Factor — chk_factor","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_factor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Factor — chk_factor","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_factor.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Factor — chk_factor","text":"vld_factor(): Validate Factor","code":""},{"path":[]},{"path":"/reference/chk_factor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Factor — chk_factor","text":"","code":"# chk_factor chk_factor(factor(\"1\")) try(chk_factor(\"1\")) #> Error in eval(expr, envir, enclos) : `\"1\"` must be factor. # vld_factor vld_factor(factor(\"1\")) #> [1] TRUE vld_factor(factor(0)) #> [1] TRUE vld_factor(\"1\") #> [1] FALSE vld_factor(1L) #> [1] FALSE"},{"path":"/reference/chk_false.html","id":null,"dir":"Reference","previous_headings":"","what":"Check FALSE — chk_false","title":"Check FALSE — chk_false","text":"Check FALSE using .logical(x) && length(x) == 1L && !anyNA(x) && !x","code":""},{"path":"/reference/chk_false.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check FALSE — chk_false","text":"","code":"chk_false(x, x_name = NULL) vld_false(x)"},{"path":"/reference/chk_false.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check FALSE — chk_false","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_false.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check FALSE — chk_false","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_false.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check FALSE — chk_false","text":"vld_false(): Validate FALSE","code":""},{"path":[]},{"path":"/reference/chk_false.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check FALSE — chk_false","text":"","code":"# chk_false chk_false(FALSE) try(chk_false(0)) #> Error in eval(expr, envir, enclos) : `0` must be FALSE. # vld_false vld_false(TRUE) #> [1] FALSE vld_false(FALSE) #> [1] TRUE vld_false(NA) #> [1] FALSE vld_false(0) #> [1] FALSE vld_false(c(FALSE, FALSE)) #> [1] FALSE"},{"path":"/reference/chk_file.html","id":null,"dir":"Reference","previous_headings":"","what":"Check File Exists — chk_file","title":"Check File Exists — chk_file","text":"Checks file exists using vld_string(x) && file.exists(x) && !dir.exists(x)","code":""},{"path":"/reference/chk_file.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check File Exists — chk_file","text":"","code":"chk_file(x, x_name = NULL) vld_file(x)"},{"path":"/reference/chk_file.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check File Exists — chk_file","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_file.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check File Exists — chk_file","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_file.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check File Exists — chk_file","text":"vld_file(): Validate File Exists","code":""},{"path":[]},{"path":"/reference/chk_file.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check File Exists — chk_file","text":"","code":"# chk_file try(chk_file(tempfile())) #> Error in eval(expr, envir, enclos) : #> `tempfile()` must specify an existing file ('/tmp/RtmpCk3GLQ/file181b576bce7d' can't be found). # vld_file vld_file(tempfile()) #> [1] FALSE"},{"path":"/reference/chk_flag.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Flag — chk_flag","title":"Check Flag — chk_flag","text":"Checks non-missing logical scalar using .logical(x) && length(x) == 1L && !anyNA(x) Pass: TRUE, FALSE. Fail: logical(0), c(TRUE, TRUE), \"TRUE\", 1, NA.","code":""},{"path":"/reference/chk_flag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Flag — chk_flag","text":"","code":"chk_flag(x, x_name = NULL) vld_flag(x)"},{"path":"/reference/chk_flag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Flag — chk_flag","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_flag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Flag — chk_flag","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_flag.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Flag — chk_flag","text":"vld_flag(): Validate Flag","code":""},{"path":[]},{"path":"/reference/chk_flag.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Flag — chk_flag","text":"","code":"# chk_flag chk_flag(TRUE) try(vld_flag(1)) #> [1] FALSE # vld_flag vld_flag(TRUE) #> [1] TRUE vld_flag(1) #> [1] FALSE"},{"path":"/reference/chk_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Function — chk_function","title":"Check Function — chk_function","text":"Checks function using .function(x) && (.null(formals) || length(formals(x)) == formals)","code":""},{"path":"/reference/chk_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Function — chk_function","text":"","code":"chk_function(x, formals = NULL, x_name = NULL) vld_function(x, formals = NULL)"},{"path":"/reference/chk_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Function — chk_function","text":"x object check. formals count number formal arguments. x_name string name object x NULL.","code":""},{"path":"/reference/chk_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Function — chk_function","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_function.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Function — chk_function","text":"vld_function(): Validate Function","code":""},{"path":[]},{"path":"/reference/chk_function.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Function — chk_function","text":"","code":"# chk_function chk_function(mean) try(chk_function(1)) #> Error in eval(expr, envir, enclos) : `1` must be a function. # vld_function vld_function(mean) #> [1] TRUE vld_function(function(x) x) #> [1] TRUE vld_function(1) #> [1] FALSE vld_function(list(1)) #> [1] FALSE"},{"path":"/reference/chk_gt.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Greater Than — chk_gt","title":"Check Greater Than — chk_gt","text":"Checks non-missing values greater value using (x[!.na(x)] > value)","code":""},{"path":"/reference/chk_gt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Greater Than — chk_gt","text":"","code":"chk_gt(x, value = 0, x_name = NULL) vld_gt(x, value = 0)"},{"path":"/reference/chk_gt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Greater Than — chk_gt","text":"x object check. value non-missing scalar value. x_name string name object x NULL.","code":""},{"path":"/reference/chk_gt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Greater Than — chk_gt","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_gt.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Greater Than — chk_gt","text":"vld_gt(): Validate Greater ","code":""},{"path":[]},{"path":"/reference/chk_gt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Greater Than — chk_gt","text":"","code":"# chk_gt chk_gt(0.1) try(chk_gt(c(0.1, -0.2))) #> Error in eval(expr, envir, enclos) : #> `c(0.1, -0.2)` must have values greater than 0. # vld_gt vld_gt(numeric(0)) #> [1] TRUE vld_gt(0) #> [1] FALSE vld_gt(0.1) #> [1] TRUE vld_gt(c(0.1, 0.2, NA)) #> [1] TRUE vld_gt(c(0.1, -0.2)) #> [1] FALSE vld_gt(c(-0.1, 0.2), value = -1) #> [1] TRUE vld_gt(\"b\", value = \"a\") #> [1] TRUE"},{"path":"/reference/chk_gte.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Greater Than or Equal To — chk_gte","title":"Check Greater Than or Equal To — chk_gte","text":"Checks non-missing values greater equal y using (x[!.na(x)] >= value)","code":""},{"path":"/reference/chk_gte.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Greater Than or Equal To — chk_gte","text":"","code":"chk_gte(x, value = 0, x_name = NULL) vld_gte(x, value = 0)"},{"path":"/reference/chk_gte.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Greater Than or Equal To — chk_gte","text":"x object check. value non-missing scalar value. x_name string name object x NULL.","code":""},{"path":"/reference/chk_gte.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Greater Than or Equal To — chk_gte","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_gte.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Greater Than or Equal To — chk_gte","text":"vld_gte(): Validate Greater Equal ","code":""},{"path":[]},{"path":"/reference/chk_gte.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Greater Than or Equal To — chk_gte","text":"","code":"# chk_gte chk_gte(0) try(chk_gte(-0.1)) #> Error in eval(expr, envir, enclos) : #> `-0.1` must be greater than or equal to 0, not -0.1. # vld_gte vld_gte(numeric(0)) #> [1] TRUE vld_gte(0) #> [1] TRUE vld_gte(-0.1) #> [1] FALSE vld_gte(c(0.1, 0.2, NA)) #> [1] TRUE vld_gte(c(0.1, 0.2, NA), value = 1) #> [1] FALSE"},{"path":"/reference/chk_identical.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Identical — chk_identical","title":"Check Identical — chk_identical","text":"Checks identical y using identical(x, y)","code":""},{"path":"/reference/chk_identical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Identical — chk_identical","text":"","code":"chk_identical(x, y, x_name = NULL) vld_identical(x, y)"},{"path":"/reference/chk_identical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Identical — chk_identical","text":"x object check. y object check . x_name string name object x NULL.","code":""},{"path":"/reference/chk_identical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Identical — chk_identical","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_identical.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Identical — chk_identical","text":"vld_identical(): Validate Identical","code":""},{"path":[]},{"path":"/reference/chk_identical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Identical — chk_identical","text":"","code":"# chk_identical chk_identical(1, 1) try(chk_identical(1, 1L)) #> Error in eval(expr, envir, enclos) : `1` must be identical to 1L. #> Use `rlang::last_error()$y` to show the object compared to. chk_identical(c(1, 1), c(1, 1)) try(chk_identical(1, c(1, 1))) #> Error in eval(expr, envir, enclos) : #> `1` must be identical to the y object of class . #> Use `rlang::last_error()$y` to show the object compared to. vld_identical(1, 1) #> [1] TRUE"},{"path":"/reference/chk_integer.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Integer — chk_integer","title":"Check Integer — chk_integer","text":"Checks integer using .integer(x)","code":""},{"path":"/reference/chk_integer.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Integer — chk_integer","text":"","code":"chk_integer(x, x_name = NULL) vld_integer(x)"},{"path":"/reference/chk_integer.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Integer — chk_integer","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_integer.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Integer — chk_integer","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_integer.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Integer — chk_integer","text":"vld_integer(): Validate Integer","code":""},{"path":[]},{"path":"/reference/chk_integer.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Integer — chk_integer","text":"","code":"# chk_integer chk_integer(1L) try(chk_integer(1)) #> Error in eval(expr, envir, enclos) : `1` must be integer. # vld_integer vld_integer(1L) #> [1] TRUE vld_integer(matrix(1:4, nrow = 2L)) #> [1] TRUE vld_integer(integer(0)) #> [1] TRUE vld_integer(NA_integer_) #> [1] TRUE vld_integer(1) #> [1] FALSE vld_integer(TRUE) #> [1] FALSE"},{"path":"/reference/chk_is.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Class — chk_is","title":"Check Class — chk_is","text":"Checks inherits class using inherits(x, class)","code":""},{"path":"/reference/chk_is.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Class — chk_is","text":"","code":"chk_is(x, class, x_name = NULL) vld_is(x, class)"},{"path":"/reference/chk_is.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Class — chk_is","text":"x object check. class string specifying class. x_name string name object x NULL.","code":""},{"path":"/reference/chk_is.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Class — chk_is","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_is.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Class — chk_is","text":"vld_is(): Validate Inherits Class","code":""},{"path":[]},{"path":"/reference/chk_is.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Class — chk_is","text":"","code":"chk_is(1, \"numeric\") try(chk_is(1L, \"double\")) #> Error in eval(expr, envir, enclos) : #> `1L` must inherit from class 'double'. # vld_is vld_is(numeric(0), \"numeric\") #> [1] TRUE vld_is(1L, \"double\") #> [1] FALSE"},{"path":"/reference/chk_join.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Join — chk_join","title":"Check Join — chk_join","text":"Checks rows x match least one y.","code":""},{"path":"/reference/chk_join.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Join — chk_join","text":"","code":"chk_join(x, y, by, x_name = NULL) vld_join(x, y, by)"},{"path":"/reference/chk_join.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Join — chk_join","text":"x object check. y data.frame columns . character vector specifying column names join x y . named names corresponding columns x. x_name string name object x NULL.","code":""},{"path":"/reference/chk_join.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Join — chk_join","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_join.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Join — chk_join","text":"vld_join(): Validate Join","code":""},{"path":[]},{"path":"/reference/chk_join.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Join — chk_join","text":"","code":"# chk_join chk_join(data.frame(z = 1), data.frame(z = 1:2), by = \"z\") try(chk_join(data.frame(z = 1), data.frame(z = 2), by = \"z\")) #> Error in eval(expr, envir, enclos) : #> All rows in `data.frame(z = 1)` must match at least one in the y object of class . #> Use `rlang::last_error()$y` to show the object compared to. # vld_join vld_join(data.frame(z = 1), data.frame(z = 1:2), by = \"z\") #> [1] TRUE vld_join(data.frame(z = 1), data.frame(z = 2), by = \"z\") #> [1] FALSE vld_join(data.frame(z = 1), data.frame(a = 1:2), by = c(z = \"a\")) #> [1] TRUE vld_join(data.frame(z = 1), data.frame(a = 2), by = c(z = \"a\")) #> [1] FALSE"},{"path":"/reference/chk_length.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Length — chk_length","title":"Check Length — chk_length","text":"Checks length particular value range using length(x) >= length && length(x) <= upper","code":""},{"path":"/reference/chk_length.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Length — chk_length","text":"","code":"chk_length(x, length = 1L, upper = length, x_name = NULL) vld_length(x, length = 1L, upper = length)"},{"path":"/reference/chk_length.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Length — chk_length","text":"x object check. length count length. upper count max length. x_name string name object x NULL.","code":""},{"path":"/reference/chk_length.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Length — chk_length","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_length.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Length — chk_length","text":"vld_length(): Validate Length","code":""},{"path":[]},{"path":"/reference/chk_length.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Length — chk_length","text":"","code":"# chk_length chk_length(\"text\") try(vld_length(\"text\", length = 2)) #> [1] FALSE # vld_length vld_length(2:1, 2) #> [1] TRUE vld_length(2:1, 1) #> [1] FALSE"},{"path":"/reference/chk_lgl.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Logical Scalar — chk_lgl","title":"Check Logical Scalar — chk_lgl","text":"Checks logical scalar using .logical(x) && length(x) == 1L","code":""},{"path":"/reference/chk_lgl.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Logical Scalar — chk_lgl","text":"","code":"chk_lgl(x, x_name = NULL) vld_lgl(x)"},{"path":"/reference/chk_lgl.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Logical Scalar — chk_lgl","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_lgl.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Logical Scalar — chk_lgl","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_lgl.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Logical Scalar — chk_lgl","text":"vld_lgl(): Validate Logical Scalar","code":""},{"path":[]},{"path":"/reference/chk_lgl.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Logical Scalar — chk_lgl","text":"","code":"# chk_lgl chk_lgl(NA) try(chk_lgl(1)) #> Error in eval(expr, envir, enclos) : #> `1` must be a logical scalar (TRUE, FALSE or NA). # vld_lgl vld_lgl(TRUE) #> [1] TRUE vld_lgl(FALSE) #> [1] TRUE vld_lgl(NA) #> [1] TRUE vld_lgl(1) #> [1] FALSE vld_lgl(c(TRUE, TRUE)) #> [1] FALSE"},{"path":"/reference/chk_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Check List — chk_list","title":"Check List — chk_list","text":"Checks list using .list(x)","code":""},{"path":"/reference/chk_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check List — chk_list","text":"","code":"chk_list(x, x_name = NULL) vld_list(x)"},{"path":"/reference/chk_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check List — chk_list","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check List — chk_list","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_list.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check List — chk_list","text":"vld_list(): Validate List","code":""},{"path":[]},{"path":"/reference/chk_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check List — chk_list","text":"","code":"# chk_list chk_list(list()) try(chk_list(1)) #> Error in eval(expr, envir, enclos) : `1` must be a list. # vld_list vld_list(list()) #> [1] TRUE vld_list(list(x = 1)) #> [1] TRUE vld_list(mtcars) #> [1] TRUE vld_list(1) #> [1] FALSE vld_list(NULL) #> [1] FALSE"},{"path":"/reference/chk_logical.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Logical — chk_logical","title":"Check Logical — chk_logical","text":"Checks logical using .logical(x)","code":""},{"path":"/reference/chk_logical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Logical — chk_logical","text":"","code":"chk_logical(x, x_name = NULL) vld_logical(x)"},{"path":"/reference/chk_logical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Logical — chk_logical","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_logical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Logical — chk_logical","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_logical.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Logical — chk_logical","text":"vld_logical(): Validate Logical","code":""},{"path":[]},{"path":"/reference/chk_logical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Logical — chk_logical","text":"","code":"# chk_logical chk_logical(TRUE) try(chk_logical(1)) #> Error in eval(expr, envir, enclos) : `1` must be logical. # vld_logical vld_logical(TRUE) #> [1] TRUE vld_logical(matrix(TRUE)) #> [1] TRUE vld_logical(logical(0)) #> [1] TRUE vld_logical(NA) #> [1] TRUE vld_logical(1) #> [1] FALSE vld_logical(\"TRUE\") #> [1] FALSE"},{"path":"/reference/chk_lt.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Less Than — chk_lt","title":"Check Less Than — chk_lt","text":"Checks non-missing values less value using (x[!.na(x)] < value)","code":""},{"path":"/reference/chk_lt.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Less Than — chk_lt","text":"","code":"chk_lt(x, value = 0, x_name = NULL) vld_lt(x, value = 0)"},{"path":"/reference/chk_lt.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Less Than — chk_lt","text":"x object check. value non-missing scalar value. x_name string name object x NULL.","code":""},{"path":"/reference/chk_lt.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Less Than — chk_lt","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_lt.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Less Than — chk_lt","text":"vld_lt(): Validate Less ","code":""},{"path":[]},{"path":"/reference/chk_lt.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Less Than — chk_lt","text":"","code":"# chk_lt chk_lt(-0.1) try(chk_lt(c(-0.1, 0.2))) #> Error in eval(expr, envir, enclos) : #> `c(-0.1, 0.2)` must have values less than 0. # vld_lt vld_lt(numeric(0)) #> [1] TRUE vld_lt(0) #> [1] FALSE vld_lt(-0.1) #> [1] TRUE vld_lt(c(-0.1, -0.2, NA)) #> [1] TRUE vld_lt(c(-0.1, 0.2)) #> [1] FALSE vld_lt(c(-0.1, 0.2), value = 1) #> [1] TRUE vld_lt(\"a\", value = \"b\") #> [1] TRUE"},{"path":"/reference/chk_lte.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Less Than or Equal To — chk_lte","title":"Check Less Than or Equal To — chk_lte","text":"Checks non-missing values less equal y using (x[!.na(x)] <= value)","code":""},{"path":"/reference/chk_lte.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Less Than or Equal To — chk_lte","text":"","code":"chk_lte(x, value = 0, x_name = NULL) vld_lte(x, value = 0)"},{"path":"/reference/chk_lte.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Less Than or Equal To — chk_lte","text":"x object check. value non-missing scalar value. x_name string name object x NULL.","code":""},{"path":"/reference/chk_lte.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Less Than or Equal To — chk_lte","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_lte.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Less Than or Equal To — chk_lte","text":"vld_lte(): Validate Less Equal ","code":""},{"path":[]},{"path":"/reference/chk_lte.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Less Than or Equal To — chk_lte","text":"","code":"# chk_lte chk_lte(0) try(chk_lte(0.1)) #> Error in eval(expr, envir, enclos) : #> `0.1` must be less than or equal to 0, not 0.1. # vld_lte vld_lte(numeric(0)) #> [1] TRUE vld_lte(0) #> [1] TRUE vld_lte(0.1) #> [1] FALSE vld_lte(c(-0.1, -0.2, NA)) #> [1] TRUE vld_lte(c(-0.1, -0.2, NA), value = -1) #> [1] FALSE"},{"path":"/reference/chk_match.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Matches — chk_match","title":"Check Matches — chk_match","text":"Checks values match regular expression using (grepl(regexp, x[!.na(x)]))","code":""},{"path":"/reference/chk_match.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Matches — chk_match","text":"","code":"chk_match(x, regexp = \".+\", x_name = NULL) vld_match(x, regexp = \".+\")"},{"path":"/reference/chk_match.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Matches — chk_match","text":"x object check. regexp string regular expression. x_name string name object x NULL.","code":""},{"path":"/reference/chk_match.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Matches — chk_match","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_match.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Matches — chk_match","text":"vld_match(): Validate Matches","code":""},{"path":[]},{"path":"/reference/chk_match.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Matches — chk_match","text":"","code":"# chk_match chk_match(\"1\") try(chk_match(\"1\", regexp = \"2\")) #> Error in eval(expr, envir, enclos) : #> `\"1\"` must match regular expression '2'. # vld_match vld_match(\"1\") #> [1] TRUE vld_match(\"a\", regexp = \"a\") #> [1] TRUE vld_match(\"\") #> [1] FALSE vld_match(\"1\", regexp = \"2\") #> [1] FALSE vld_match(NA_character_, regexp = \".*\") #> [1] TRUE"},{"path":"/reference/chk_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Matrix — chk_matrix","title":"Check Matrix — chk_matrix","text":"Checks matrix using .matrix(x)","code":""},{"path":"/reference/chk_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Matrix — chk_matrix","text":"","code":"chk_matrix(x, x_name = NULL) vld_matrix(x)"},{"path":"/reference/chk_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Matrix — chk_matrix","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Matrix — chk_matrix","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_matrix.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Matrix — chk_matrix","text":"vld_matrix(): Validate Matrix","code":""},{"path":[]},{"path":"/reference/chk_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Matrix — chk_matrix","text":"","code":"# chk_matrix chk_matrix(matrix(1)) try(chk_matrix(array(1))) #> Error in eval(expr, envir, enclos) : `array(1)` must be an matrix. # vld_matrix vld_matrix(1) #> [1] FALSE vld_matrix(matrix(1)) #> [1] TRUE"},{"path":"/reference/chk_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Missing Argument — chk_missing","title":"Check Missing Argument — chk_missing","text":"Checks argument missing using missing(x)","code":""},{"path":"/reference/chk_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Missing Argument — chk_missing","text":"","code":"chk_missing(x, x_name = NULL) vld_missing(x)"},{"path":"/reference/chk_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Missing Argument — chk_missing","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Missing Argument — chk_missing","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_missing.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Missing Argument — chk_missing","text":"Currently checks value available (opposed whether specified).","code":""},{"path":"/reference/chk_missing.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Missing Argument — chk_missing","text":"vld_missing(): Validate Missing Argument","code":""},{"path":[]},{"path":"/reference/chk_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Missing Argument — chk_missing","text":"","code":"# chk_missing fun <- function(x) { chk_missing(x) } fun() try(fun(1)) #> Error in fun(1) : `x` must be missing. # vld_missing fun <- function(x) { vld_missing(x) } fun() #> [1] TRUE fun(1) #> [1] FALSE"},{"path":"/reference/chk_named.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Named — chk_named","title":"Check Named — chk_named","text":"Checks named using !.null(names(x))","code":""},{"path":"/reference/chk_named.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Named — chk_named","text":"","code":"chk_named(x, x_name = NULL) vld_named(x)"},{"path":"/reference/chk_named.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Named — chk_named","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_named.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Named — chk_named","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_named.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Named — chk_named","text":"vld_named(): Validate Named","code":""},{"path":[]},{"path":"/reference/chk_named.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Named — chk_named","text":"","code":"# chk_named chk_named(c(x = 1)) try(chk_named(list(1))) #> Error in eval(expr, envir, enclos) : `list(1)` must be named. # vld_named vld_named(c(x = 1)) #> [1] TRUE vld_named(list(x = 1)) #> [1] TRUE vld_named(c(x = 1)[-1]) #> [1] TRUE vld_named(list(x = 1)[-1]) #> [1] TRUE vld_named(1) #> [1] FALSE vld_named(list(1)) #> [1] FALSE"},{"path":"/reference/chk_not_any_na.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Not Any Missing Values — chk_not_any_na","title":"Check Not Any Missing Values — chk_not_any_na","text":"Checks missing values using !anyNA(x) Pass: 1, 1:2, \"1\", logical(0). Fail: NA, c(1, NA).","code":""},{"path":"/reference/chk_not_any_na.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Not Any Missing Values — chk_not_any_na","text":"","code":"chk_not_any_na(x, x_name = NULL) vld_not_any_na(x)"},{"path":"/reference/chk_not_any_na.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Not Any Missing Values — chk_not_any_na","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_any_na.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Not Any Missing Values — chk_not_any_na","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_not_any_na.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Not Any Missing Values — chk_not_any_na","text":"vld_not_any_na(): Validate Missing Values","code":""},{"path":[]},{"path":"/reference/chk_not_any_na.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Not Any Missing Values — chk_not_any_na","text":"","code":"# chk_not_any_na chk_not_any_na(1) try(chk_not_any_na(NA)) #> Error in eval(expr, envir, enclos) : #> `NA` must not have any missing values. # vld_not_any_na vld_not_any_na(1) #> [1] TRUE vld_not_any_na(1:2) #> [1] TRUE vld_not_any_na(NA_real_) #> [1] FALSE vld_not_any_na(integer(0)) #> [1] TRUE vld_not_any_na(c(NA, 1)) #> [1] FALSE vld_not_any_na(TRUE) #> [1] TRUE"},{"path":"/reference/chk_not_empty.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Not Empty — chk_not_empty","title":"Check Not Empty — chk_not_empty","text":"Checks empty using length(x) != 0L Pass: 1, 1:2, NA, matrix(1:3), list(1), data.frame(x = 1). Fail: NULL, logical(0), list(), data.frame().","code":""},{"path":"/reference/chk_not_empty.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Not Empty — chk_not_empty","text":"","code":"chk_not_empty(x, x_name = NULL) vld_not_empty(x)"},{"path":"/reference/chk_not_empty.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Not Empty — chk_not_empty","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_empty.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Not Empty — chk_not_empty","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_not_empty.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Not Empty — chk_not_empty","text":"vld_not_empty(): Validate Empty","code":""},{"path":[]},{"path":"/reference/chk_not_empty.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Not Empty — chk_not_empty","text":"","code":"# chk_not_empty chk_not_empty(1) try(chk_not_empty(numeric(0))) #> Error in eval(expr, envir, enclos) : #> `numeric(0)` must not be empty (zero length). # vld_not_empty vld_not_empty(1) #> [1] TRUE vld_not_empty(matrix(1:3)) #> [1] TRUE vld_not_empty(character(0)) #> [1] FALSE vld_not_empty(list(1)) #> [1] TRUE vld_not_empty(NULL) #> [1] FALSE vld_not_empty(list()) #> [1] FALSE"},{"path":"/reference/chk_not_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Not Missing Argument — chk_not_missing","title":"Check Not Missing Argument — chk_not_missing","text":"Checks argument missing using !missing(x)","code":""},{"path":"/reference/chk_not_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Not Missing Argument — chk_not_missing","text":"","code":"chk_not_missing(x, x_name = \"`x`\") vld_not_missing(x)"},{"path":"/reference/chk_not_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Not Missing Argument — chk_not_missing","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Not Missing Argument — chk_not_missing","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_not_missing.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Not Missing Argument — chk_not_missing","text":"Currently checks value available (opposed whether specified).","code":""},{"path":"/reference/chk_not_missing.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Not Missing Argument — chk_not_missing","text":"vld_not_missing(): Validate Missing Argument","code":""},{"path":[]},{"path":"/reference/chk_not_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Not Missing Argument — chk_not_missing","text":"","code":"# chk_not_missing fun <- function(x) { chk_not_missing(x) } fun(1) try(fun()) #> Error in fun() : `x` must not be missing. # vld_not_missing fun <- function(x) { vld_not_missing(x) } fun() #> [1] FALSE fun(1) #> [1] TRUE"},{"path":"/reference/chk_not_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Check not NULL — chk_not_null","title":"Check not NULL — chk_not_null","text":"Checks NULL using !.null(x)","code":""},{"path":"/reference/chk_not_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check not NULL — chk_not_null","text":"","code":"chk_not_null(x, x_name = NULL) vld_not_null(x)"},{"path":"/reference/chk_not_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check not NULL — chk_not_null","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check not NULL — chk_not_null","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_not_null.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check not NULL — chk_not_null","text":"vld_not_null(): Validate NULL","code":""},{"path":[]},{"path":"/reference/chk_not_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check not NULL — chk_not_null","text":"","code":"# chk_not_null try(chk_not_null(NULL)) #> Error in eval(expr, envir, enclos) : `NULL` must not be NULL. chk_not_null(1) # vld_not_null vld_not_null(1) #> [1] TRUE vld_not_null(NULL) #> [1] FALSE"},{"path":"/reference/chk_not_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Not Subset — chk_not_subset","title":"Check Not Subset — chk_not_subset","text":"Checks values values using !(x %% values) || !length(x)","code":""},{"path":"/reference/chk_not_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Not Subset — chk_not_subset","text":"","code":"chk_not_subset(x, values, x_name = NULL)"},{"path":"/reference/chk_not_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Not Subset — chk_not_subset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_not_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Not Subset — chk_not_subset","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":[]},{"path":"/reference/chk_not_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Not Subset — chk_not_subset","text":"","code":"# chk_not_subset chk_not_subset(11, 1:10) try(chk_not_subset(1, 1:10)) #> Error in eval(expr, envir, enclos) : #> `1` must not match 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10."},{"path":"/reference/chk_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Check NULL — chk_null","title":"Check NULL — chk_null","text":"Checks NULL using .null(x)","code":""},{"path":"/reference/chk_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check NULL — chk_null","text":"","code":"chk_null(x, x_name = NULL) vld_null(x)"},{"path":"/reference/chk_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check NULL — chk_null","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check NULL — chk_null","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_null.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check NULL — chk_null","text":"vld_null(): Validate NULL","code":""},{"path":[]},{"path":"/reference/chk_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check NULL — chk_null","text":"","code":"# chk_null try(chk_null(1)) #> Error in eval(expr, envir, enclos) : `1` must be NULL. chk_null(NULL) # vld_null vld_null(NULL) #> [1] TRUE vld_null(1) #> [1] FALSE"},{"path":"/reference/chk_null_or.html","id":null,"dir":"Reference","previous_headings":"","what":"Check NULL Or — chk_null_or","title":"Check NULL Or — chk_null_or","text":"Checks NULL passes test.","code":""},{"path":"/reference/chk_null_or.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check NULL Or — chk_null_or","text":"","code":"chk_null_or(x, chk, ..., vld, x_name = NULL)"},{"path":"/reference/chk_null_or.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check NULL Or — chk_null_or","text":"x object check. chk chk function. Soft-deprecated vld. ... Arguments passed chk. vld vld function. x_name string name object x NULL.","code":""},{"path":"/reference/chk_null_or.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check NULL Or — chk_null_or","text":"informative error test fails.","code":""},{"path":"/reference/chk_null_or.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check NULL Or — chk_null_or","text":"","code":"chk_null_or(NULL, chk_number) #> Warning: The `chk` argument of `chk_null_or()` is deprecated as of chk 0.6.1. #> ℹ Please use the `vld` argument instead. chk_null_or(1, chk_number) try(chk_null_or(\"1\", chk_number)) #> Error in eval(expr, envir, enclos) : #> `\"1\"` must be a number (non-missing numeric scalar) or NULL."},{"path":"/reference/chk_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Number — chk_number","title":"Check Number — chk_number","text":"Checks non-missing numeric scalar using .numeric(x) && length(x) == 1L && !anyNA(x) Pass: 1, 2L, log(10), -Inf Fail: \"\", 1:3, NA_real_","code":""},{"path":"/reference/chk_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Number — chk_number","text":"","code":"chk_number(x, x_name = NULL) vld_number(x)"},{"path":"/reference/chk_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Number — chk_number","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Number — chk_number","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_number.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Number — chk_number","text":"vld_number(): Validate Number","code":""},{"path":[]},{"path":"/reference/chk_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Number — chk_number","text":"","code":"# chk_number chk_number(1.1) try(chk_number(TRUE)) #> Error in eval(expr, envir, enclos) : #> `TRUE` must be a number (non-missing numeric scalar). # vld_number vld_number(1.1) #> [1] TRUE"},{"path":"/reference/chk_numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Numeric — chk_numeric","title":"Check Numeric — chk_numeric","text":"Checks numeric using .numeric(x) Pass: 1, 1:2, NA_real_, integer(0), matrix(1:3). Fail: TRUE, \"1\", NA, NULL.","code":""},{"path":"/reference/chk_numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Numeric — chk_numeric","text":"","code":"chk_numeric(x, x_name = NULL) vld_numeric(x)"},{"path":"/reference/chk_numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Numeric — chk_numeric","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_numeric.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Numeric — chk_numeric","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_numeric.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Numeric — chk_numeric","text":"vld_numeric(): Validate Numeric","code":""},{"path":[]},{"path":"/reference/chk_numeric.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Numeric — chk_numeric","text":"","code":"# chk_numeric chk_numeric(1) try(chk_numeric(\"1\")) #> Error in eval(expr, envir, enclos) : `\"1\"` must be numeric. # vld_numeric vld_numeric(1) #> [1] TRUE vld_numeric(1:2) #> [1] TRUE vld_numeric(NA_real_) #> [1] TRUE vld_numeric(integer(0)) #> [1] TRUE vld_numeric(\"1\") #> [1] FALSE vld_numeric(TRUE) #> [1] FALSE"},{"path":"/reference/chk_orderset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Set Ordered — chk_orderset","title":"Check Set Ordered — chk_orderset","text":"Checks first occurrence shared element x equivalent first occurrence shared element values using vld_equivalent(unique(x[x %% values]), values[values %% x]).","code":""},{"path":"/reference/chk_orderset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Set Ordered — chk_orderset","text":"","code":"chk_orderset(x, values, x_name = NULL)"},{"path":"/reference/chk_orderset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Set Ordered — chk_orderset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_orderset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Set Ordered — chk_orderset","text":"chk_ function throws informative error test fails. vld_ function returns flag indicating whether test met.","code":""},{"path":[]},{"path":"/reference/chk_orderset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Set Ordered — chk_orderset","text":"","code":"# chk_orderset chk_orderset(1:2, 1:2) try(chk_orderset(2:1, 1:2)) #> Error in eval(expr, envir, enclos) : #> `2:1` must have (the first occurence of) each of the following elements in the following order: 1, 2."},{"path":"/reference/chk_range.html","id":null,"dir":"Reference","previous_headings":"","what":"Checks range of non-missing values — chk_range","title":"Checks range of non-missing values — chk_range","text":"Checks non-missing values fall within range using inclusive (x[!.na(x)] >= range[1] & x[!.na(x)] <= range[2]) else (x[!.na(x)] > range[1] & x[!.na(x)] < range[2])","code":""},{"path":"/reference/chk_range.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Checks range of non-missing values — chk_range","text":"","code":"chk_range(x, range = c(0, 1), inclusive = TRUE, x_name = NULL) vld_range(x, range = c(0, 1), inclusive = TRUE)"},{"path":"/reference/chk_range.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Checks range of non-missing values — chk_range","text":"x object check. range non-missing sorted vector length 2 lower upper permitted values. inclusive flag specifying whether range exclusive. x_name string name object x NULL.","code":""},{"path":"/reference/chk_range.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Checks range of non-missing values — chk_range","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_range.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Checks range of non-missing values — chk_range","text":"vld_range(): Validate Range","code":""},{"path":[]},{"path":"/reference/chk_range.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Checks range of non-missing values — chk_range","text":"","code":"# chk_range chk_range(0) try(chk_range(-0.1)) #> Error in eval(expr, envir, enclos) : #> `-0.1` must be between 0 and 1, not -0.1. # vld_range vld_range(numeric(0)) #> [1] TRUE vld_range(0) #> [1] TRUE vld_range(-0.1) #> [1] FALSE vld_range(c(0.1, 0.2, NA)) #> [1] TRUE vld_range(c(0.1, 0.2, NA), range = c(0, 1)) #> [1] TRUE"},{"path":"/reference/chk_s3_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Type — chk_s3_class","title":"Check Type — chk_s3_class","text":"Checks inherits S3 class using !isS4(x) && inherits(x, class)","code":""},{"path":"/reference/chk_s3_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Type — chk_s3_class","text":"","code":"chk_s3_class(x, class, x_name = NULL) vld_s3_class(x, class)"},{"path":"/reference/chk_s3_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Type — chk_s3_class","text":"x object check. class string specifying class. x_name string name object x NULL.","code":""},{"path":"/reference/chk_s3_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Type — chk_s3_class","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_s3_class.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Type — chk_s3_class","text":"vld_s3_class(): Validate Inherits S3 Class","code":""},{"path":[]},{"path":"/reference/chk_s3_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Type — chk_s3_class","text":"","code":"# chk_s3_class chk_s3_class(1, \"numeric\") try(chk_s3_class(getClass(\"MethodDefinition\"), \"classRepresentation\")) #> Error in eval(expr, envir, enclos) : #> `getClass(\"MethodDefinition\")` must inherit from S3 class 'classRepresentation'. # vld_s3_class vld_s3_class(numeric(0), \"numeric\") #> [1] TRUE vld_s3_class(getClass(\"MethodDefinition\"), \"classRepresentation\") #> [1] FALSE"},{"path":"/reference/chk_s4_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Inherits from S4 Class — chk_s4_class","title":"Check Inherits from S4 Class — chk_s4_class","text":"Checks inherits S4 class using isS4(x) && methods::(x, class)","code":""},{"path":"/reference/chk_s4_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Inherits from S4 Class — chk_s4_class","text":"","code":"chk_s4_class(x, class, x_name = NULL) vld_s4_class(x, class)"},{"path":"/reference/chk_s4_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Inherits from S4 Class — chk_s4_class","text":"x object check. class string specifying class. x_name string name object x NULL.","code":""},{"path":"/reference/chk_s4_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Inherits from S4 Class — chk_s4_class","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_s4_class.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Inherits from S4 Class — chk_s4_class","text":"vld_s4_class(): Validate Inherits S4 Class","code":""},{"path":[]},{"path":"/reference/chk_s4_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Inherits from S4 Class — chk_s4_class","text":"","code":"# chk_s4_class try(chk_s4_class(1, \"numeric\")) #> Error in eval(expr, envir, enclos) : #> `1` must inherit from S4 class 'numeric'. chk_s4_class(getClass(\"MethodDefinition\"), \"classRepresentation\") # vld_s4_class vld_s4_class(numeric(0), \"numeric\") #> [1] FALSE vld_s4_class(getClass(\"MethodDefinition\"), \"classRepresentation\") #> [1] TRUE"},{"path":"/reference/chk_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Scalar — chk_scalar","title":"Check Scalar — chk_scalar","text":"Checks vector using length(x) == 1L","code":""},{"path":"/reference/chk_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Scalar — chk_scalar","text":"","code":"chk_scalar(x, x_name = NULL) vld_scalar(x)"},{"path":"/reference/chk_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Scalar — chk_scalar","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Scalar — chk_scalar","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_scalar.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Scalar — chk_scalar","text":"vld_scalar(): Validate Scalar","code":""},{"path":[]},{"path":"/reference/chk_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Scalar — chk_scalar","text":"","code":"# chk_scalar chk_scalar(1) chk_scalar(list(1)) try(chk_scalar(1:2)) #> Error in eval(expr, envir, enclos) : `1:2` must be a scalar (length 1). # vld_scalar vld_scalar(1) #> [1] TRUE"},{"path":"/reference/chk_setequal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Set Equal — vld_orderset","title":"Check Set Equal — vld_orderset","text":"Checks equal set using setequal(x, values)","code":""},{"path":"/reference/chk_setequal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Set Equal — vld_orderset","text":"","code":"vld_orderset(x, values) chk_setequal(x, values, x_name = NULL) vld_setequal(x, values)"},{"path":"/reference/chk_setequal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Set Equal — vld_orderset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_setequal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Set Equal — vld_orderset","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_setequal.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Set Equal — vld_orderset","text":"vld_orderset(): Validate Set Ordered vld_setequal(): Validate Set Equal","code":""},{"path":[]},{"path":"/reference/chk_setequal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Set Equal — vld_orderset","text":"","code":"# vld_orderset vld_orderset(1, 1) #> [1] TRUE vld_orderset(1:2, 2:1) #> [1] FALSE vld_orderset(1, 2:1) #> [1] TRUE vld_orderset(1:2, 2) #> [1] TRUE # chk_setequal chk_setequal(1:2, 2:1) try(chk_setequal(1, 1:2)) #> Error in eval(expr, envir, enclos) : `1` must equal set: 1, 2. # vld_setequal vld_setequal(1, 1) #> [1] TRUE vld_setequal(1:2, 2:1) #> [1] TRUE vld_setequal(1, 2:1) #> [1] FALSE vld_setequal(1:2, 2) #> [1] FALSE"},{"path":"/reference/chk_sorted.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Sorted — chk_sorted","title":"Check Sorted — chk_sorted","text":"Checks sorted using .unsorted(x, na.rm = TRUE)","code":""},{"path":"/reference/chk_sorted.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Sorted — chk_sorted","text":"","code":"chk_sorted(x, x_name = NULL) vld_sorted(x)"},{"path":"/reference/chk_sorted.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Sorted — chk_sorted","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_sorted.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Sorted — chk_sorted","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_sorted.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Sorted — chk_sorted","text":"vld_sorted(): Validate Sorted","code":""},{"path":[]},{"path":"/reference/chk_sorted.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Sorted — chk_sorted","text":"","code":"# chk_sorted chk_sorted(1:2) try(chk_sorted(2:1)) #> Error in eval(expr, envir, enclos) : `2:1` must be sorted. # vld_sorted vld_sorted(1:2) #> [1] TRUE vld_sorted(2:1) #> [1] FALSE"},{"path":"/reference/chk_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Check String — chk_string","title":"Check String — chk_string","text":"Checks string .character(x) && length(x) == 1L && !anyNA(x)","code":""},{"path":"/reference/chk_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check String — chk_string","text":"","code":"chk_string(x, x_name = NULL) vld_string(x)"},{"path":"/reference/chk_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check String — chk_string","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check String — chk_string","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_string.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check String — chk_string","text":"vld_string(): Validate String","code":""},{"path":[]},{"path":"/reference/chk_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check String — chk_string","text":"","code":"# chk_string chk_string(\"1\") try(chk_string(1)) #> Error in eval(expr, envir, enclos) : #> `1` must be a string (non-missing character scalar). # vld_string vld_string(\"1\") #> [1] TRUE vld_string(\"\") #> [1] TRUE vld_string(1) #> [1] FALSE vld_string(NA_character_) #> [1] FALSE vld_string(c(\"1\", \"1\")) #> [1] FALSE"},{"path":"/reference/chk_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Subset — vld_not_subset","title":"Check Subset — vld_not_subset","text":"Checks values values using (x %% values)","code":""},{"path":"/reference/chk_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Subset — vld_not_subset","text":"","code":"vld_not_subset(x, values) chk_subset(x, values, x_name = NULL) vld_subset(x, values)"},{"path":"/reference/chk_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Subset — vld_not_subset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Subset — vld_not_subset","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_subset.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Subset — vld_not_subset","text":"vld_not_subset(): Validate Subset vld_subset(): Validate Subset","code":""},{"path":[]},{"path":"/reference/chk_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Subset — vld_not_subset","text":"","code":"# vld_not_subset vld_not_subset(numeric(0), 1:10) #> [1] TRUE vld_not_subset(1, 1:10) #> [1] FALSE vld_not_subset(11, 1:10) #> [1] TRUE # chk_subset chk_subset(1, 1:10) try(chk_subset(11, 1:10)) #> Error in eval(expr, envir, enclos) : #> `11` must match 1, 2, 3, 4, 5, 6, 7, 8, 9 or 10, not 11. # vld_subset vld_subset(numeric(0), 1:10) #> [1] TRUE vld_subset(1, 1:10) #> [1] TRUE vld_subset(11, 1:10) #> [1] FALSE"},{"path":"/reference/chk_superset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Superset — chk_superset","title":"Check Superset — chk_superset","text":"Checks includes values using (values %% x)","code":""},{"path":"/reference/chk_superset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Superset — chk_superset","text":"","code":"chk_superset(x, values, x_name = NULL) vld_superset(x, values)"},{"path":"/reference/chk_superset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Superset — chk_superset","text":"x object check. values vector permitted values. x_name string name object x NULL.","code":""},{"path":"/reference/chk_superset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Superset — chk_superset","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_superset.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Superset — chk_superset","text":"vld_superset(): Validates Superset","code":""},{"path":[]},{"path":"/reference/chk_superset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Superset — chk_superset","text":"","code":"# chk_superset chk_superset(1:3, 1) try(chk_superset(1:3, 4)) #> Error in eval(expr, envir, enclos) : `1:3` must include 4. # vld_superset vld_superset(1:3, 1) #> [1] TRUE vld_superset(1:3, 4) #> [1] FALSE vld_superset(integer(0), integer(0)) #> [1] TRUE"},{"path":"/reference/chk_true.html","id":null,"dir":"Reference","previous_headings":"","what":"Check TRUE — chk_true","title":"Check TRUE — chk_true","text":"Checks TRUE using .logical(x) && length(x) == 1L && !anyNA(x) && x","code":""},{"path":"/reference/chk_true.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check TRUE — chk_true","text":"","code":"chk_true(x, x_name = NULL) vld_true(x)"},{"path":"/reference/chk_true.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check TRUE — chk_true","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_true.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check TRUE — chk_true","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_true.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check TRUE — chk_true","text":"vld_true(): Validate TRUE","code":""},{"path":[]},{"path":"/reference/chk_true.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check TRUE — chk_true","text":"","code":"# chk_true chk_true(TRUE) try(chk_true(1)) #> Error in eval(expr, envir, enclos) : `1` must be TRUE. # vld_true vld_true(TRUE) #> [1] TRUE vld_true(FALSE) #> [1] FALSE vld_true(NA) #> [1] FALSE vld_true(0) #> [1] FALSE vld_true(c(TRUE, TRUE)) #> [1] FALSE"},{"path":"/reference/chk_tz.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Time Zone — chk_tz","title":"Check Time Zone — chk_tz","text":"Checks non-missing valid scalar timezone using .character(x) && length(x) == 1L && !anyNA(x) && x %% OlsonNames()","code":""},{"path":"/reference/chk_tz.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Time Zone — chk_tz","text":"","code":"chk_tz(x, x_name = NULL) vld_tz(x)"},{"path":"/reference/chk_tz.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Time Zone — chk_tz","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_tz.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Time Zone — chk_tz","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_tz.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Time Zone — chk_tz","text":"vld_tz(): Validate Time Zone","code":""},{"path":[]},{"path":"/reference/chk_tz.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Time Zone — chk_tz","text":"","code":"chk_tz(\"UTC\") try(chk_tz(\"TCU\")) #> Error in eval(expr, envir, enclos) : #> `\"TCU\"` must be a tz (non-missing scalar character of a recognized timezone). vld_tz(\"UTC\") #> [1] TRUE vld_tz(\"TCU\") #> [1] FALSE"},{"path":"/reference/chk_unique.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Unique — chk_unique","title":"Check Unique — chk_unique","text":"Checks unique using !anyDuplicated(x, incomparables = incomparables)","code":""},{"path":"/reference/chk_unique.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Unique — chk_unique","text":"","code":"chk_unique(x, incomparables = FALSE, x_name = NULL) vld_unique(x, incomparables = FALSE)"},{"path":"/reference/chk_unique.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Unique — chk_unique","text":"x object check. incomparables vector values compared. FALSE means values can compared. x_name string name object x NULL.","code":""},{"path":"/reference/chk_unique.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Unique — chk_unique","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_unique.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Unique — chk_unique","text":"vld_unique(): Validate Unique","code":""},{"path":[]},{"path":"/reference/chk_unique.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Unique — chk_unique","text":"","code":"# chk_unique chk_unique(c(NA, 2)) try(chk_unique(c(NA, NA, 2))) #> Error in eval(expr, envir, enclos) : `c(NA, NA, 2)` must be unique. chk_unique(c(NA, NA, 2), incomparables = NA) # vld_unique vld_unique(NULL) #> [1] TRUE vld_unique(numeric(0)) #> [1] TRUE vld_unique(c(NA, 2)) #> [1] TRUE vld_unique(c(NA, NA, 2)) #> [1] FALSE vld_unique(c(NA, NA, 2), incomparables = NA) #> [1] TRUE"},{"path":"/reference/chk_unused.html","id":null,"dir":"Reference","previous_headings":"","what":"Check ... Unused — chk_unused","title":"Check ... Unused — chk_unused","text":"Checks ... unused length(list(...)) == 0L","code":""},{"path":"/reference/chk_unused.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check ... Unused — chk_unused","text":"","code":"chk_unused(...) vld_unused(...)"},{"path":"/reference/chk_unused.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check ... Unused — chk_unused","text":"... Additional arguments.","code":""},{"path":"/reference/chk_unused.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check ... Unused — chk_unused","text":"chk_ function throws informative error test fails.","code":""},{"path":"/reference/chk_unused.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check ... Unused — chk_unused","text":"vld_unused(): Validate ... Unused","code":""},{"path":[]},{"path":"/reference/chk_unused.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check ... Unused — chk_unused","text":"","code":"# chk_unused fun <- function(x, ...) { chk_unused(...) x } fun(1) #> [1] 1 try(fun(1, 2)) #> Error in fun(1, 2) : `...` must be unused. # vld_unused fun <- function(x, ...) { vld_unused(...) } fun(1) #> [1] TRUE try(fun(1, 2)) #> [1] FALSE"},{"path":"/reference/chk_used.html","id":null,"dir":"Reference","previous_headings":"","what":"Check ... Used — chk_used","title":"Check ... Used — chk_used","text":"Checks ... used using length(list(...)) != 0L","code":""},{"path":"/reference/chk_used.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check ... Used — chk_used","text":"","code":"chk_used(...) vld_used(...)"},{"path":"/reference/chk_used.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check ... Used — chk_used","text":"... Additional arguments.","code":""},{"path":"/reference/chk_used.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check ... Used — chk_used","text":"chk_ function throws informative error test fails.","code":""},{"path":"/reference/chk_used.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check ... Used — chk_used","text":"vld_used(): Validate ... Used","code":""},{"path":[]},{"path":"/reference/chk_used.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check ... Used — chk_used","text":"","code":"# chk_used fun <- function(x, ...) { chk_used(...) x } try(fun(1)) #> Error in fun(1) : `...` must be used. fun(1, 2) #> [1] 1 # vld_used fun <- function(x, ...) { vld_used(...) } fun(1) #> [1] FALSE fun(1, 2) #> [1] TRUE"},{"path":"/reference/chk_valid_name.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Valid Name — chk_valid_name","title":"Check Valid Name — chk_valid_name","text":"Checks valid name using identical(make.names(x[!.na(x)]), .character(x[!.na(x)]))","code":""},{"path":"/reference/chk_valid_name.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Valid Name — chk_valid_name","text":"","code":"chk_valid_name(x, x_name = NULL) vld_valid_name(x)"},{"path":"/reference/chk_valid_name.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Valid Name — chk_valid_name","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_valid_name.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Valid Name — chk_valid_name","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_valid_name.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Valid Name — chk_valid_name","text":"vld_valid_name(): Validate Valid Name","code":""},{"path":[]},{"path":"/reference/chk_valid_name.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Valid Name — chk_valid_name","text":"","code":"# chk_valid_name chk_valid_name(\"text\") try(chk_valid_name(\".1\")) #> Error in eval(expr, envir, enclos) : `\".1\"` must be valid name. # vld_valid_name vld_valid_name(\".1\") #> [1] FALSE"},{"path":"/reference/chk_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Vector — chk_vector","title":"Check Vector — chk_vector","text":"Checks vector using (.atomic(x) && !.matrix(x) && !.array(x)) || .list(x)","code":""},{"path":"/reference/chk_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Vector — chk_vector","text":"","code":"chk_vector(x, x_name = NULL) vld_vector(x)"},{"path":"/reference/chk_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Vector — chk_vector","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Vector — chk_vector","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_vector.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Check Vector — chk_vector","text":".vector(x) reliable returns TRUE object vector attributes apart names.","code":""},{"path":"/reference/chk_vector.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Vector — chk_vector","text":"vld_vector(): Validate Vector","code":""},{"path":[]},{"path":"/reference/chk_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Vector — chk_vector","text":"","code":"# chk_vector chk_vector(1) chk_vector(list()) try(chk_vector(matrix(1))) #> Error in eval(expr, envir, enclos) : `matrix(1)` must be a vector. # vld_vector vld_vector(1) #> [1] TRUE"},{"path":"/reference/chk_whole_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Whole Number — chk_whole_number","title":"Check Whole Number — chk_whole_number","text":"Checks non-missing integer scalar double equivalent using vld_number(x) && (.integer(x) || vld_true(.equal(x, trunc(x)))) Pass: 1, 2L, 1e10, -Inf Fail: \"\", 1:3, NA_integer_, log(10)","code":""},{"path":"/reference/chk_whole_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Whole Number — chk_whole_number","text":"","code":"chk_whole_number(x, x_name = NULL) vld_whole_number(x)"},{"path":"/reference/chk_whole_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Whole Number — chk_whole_number","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_whole_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Whole Number — chk_whole_number","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_whole_number.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Whole Number — chk_whole_number","text":"vld_whole_number(): Validate Whole Number","code":""},{"path":[]},{"path":"/reference/chk_whole_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Whole Number — chk_whole_number","text":"","code":"# chk_whole_number chk_whole_number(2) try(chk_whole_number(1.1)) #> Error in eval(expr, envir, enclos) : #> `1.1` must be a whole number (non-missing integer scalar or double equivalent). # vld_whole_number vld_whole_number(2) #> [1] TRUE"},{"path":"/reference/chk_whole_numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Whole Numeric — chk_whole_numeric","title":"Check Whole Numeric — chk_whole_numeric","text":"Checks integer vector double equivalent using .integer(x) || (.double(x) && vld_true(.equal(x, .integer(x))))","code":""},{"path":"/reference/chk_whole_numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Whole Numeric — chk_whole_numeric","text":"","code":"chk_whole_numeric(x, x_name = NULL) vld_whole_numeric(x)"},{"path":"/reference/chk_whole_numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Whole Numeric — chk_whole_numeric","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_whole_numeric.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Whole Numeric — chk_whole_numeric","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_whole_numeric.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Whole Numeric — chk_whole_numeric","text":"vld_whole_numeric(): Validate Whole Numeric","code":""},{"path":[]},{"path":"/reference/chk_whole_numeric.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Whole Numeric — chk_whole_numeric","text":"","code":"# chk_whole_numeric chk_whole_numeric(1) try(chk_whole_numeric(1.1)) #> Error in eval(expr, envir, enclos) : #> `1.1` must be a whole numeric vector (integer vector or double equivalent). # vld_whole_numeric vld_whole_numeric(1) #> [1] TRUE vld_whole_numeric(NA_real_) #> [1] TRUE vld_whole_numeric(1:2) #> [1] TRUE vld_whole_numeric(double(0)) #> [1] TRUE vld_whole_numeric(TRUE) #> [1] FALSE vld_whole_numeric(1.5) #> [1] FALSE"},{"path":"/reference/chk_wnum.html","id":null,"dir":"Reference","previous_headings":"","what":"Check Whole Numeric Scalar — chk_wnum","title":"Check Whole Numeric Scalar — chk_wnum","text":"Checks whole numeric scalar using .numeric(x) && length(x) == 1L && (.integer(x) || vld_true(.equal(x, trunc(x))))","code":""},{"path":"/reference/chk_wnum.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check Whole Numeric Scalar — chk_wnum","text":"","code":"chk_wnum(x, x_name = NULL) vld_wnum(x)"},{"path":"/reference/chk_wnum.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check Whole Numeric Scalar — chk_wnum","text":"x object check. x_name string name object x NULL.","code":""},{"path":"/reference/chk_wnum.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check Whole Numeric Scalar — chk_wnum","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/reference/chk_wnum.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Check Whole Numeric Scalar — chk_wnum","text":"vld_wnum(): Validate Whole Numeric Scalar","code":""},{"path":[]},{"path":"/reference/chk_wnum.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check Whole Numeric Scalar — chk_wnum","text":"","code":"# chk_wnum chk_wnum(1) try(chk_wnum(1.1)) #> Warning: `chk_wnum()` was deprecated in chk 0.6.1. #> ℹ Please use `chk::chk_scalar(x);` `chk::chk_whole_numeric(x)` instead #> Error in eval(expr, envir, enclos) : #> `1.1` must be a whole numeric scalar. # vld_wnum vld_wnum(1) #> [1] TRUE vld_wnum(double(0)) #> [1] FALSE vld_wnum(NA_real_) #> [1] TRUE vld_wnum(c(1, 1)) #> [1] FALSE vld_wnum(1L) #> [1] TRUE"},{"path":"/reference/chkor.html","id":null,"dir":"Reference","previous_headings":"","what":"Check OR — chkor","title":"Check OR — chkor","text":"chkor() function deprecated faster chkor_vld().","code":""},{"path":"/reference/chkor.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check OR — chkor","text":"","code":"chkor(...)"},{"path":"/reference/chkor.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check OR — chkor","text":"... Multiple chk_ functions.","code":""},{"path":"/reference/chkor.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check OR — chkor","text":"informative error test fails.","code":""},{"path":[]},{"path":[]},{"path":"/reference/chkor.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check OR — chkor","text":"","code":"chkor() #> Warning: `chkor()` was deprecated in chk 0.6.1. #> ℹ Please use `chkor_vld()` instead. chkor(chk_flag(TRUE)) try(chkor(chk_flag(1))) #> Error in chkor(chk_flag(1)) : `1` must be a flag (TRUE or FALSE). try(chkor(chk_flag(1), chk_flag(2))) #> Error in chkor(chk_flag(1), chk_flag(2)) : #> At least one of the following conditions must be met: #> * `1` must be a flag (TRUE or FALSE). #> * `2` must be a flag (TRUE or FALSE). chkor(chk_flag(1), chk_flag(TRUE))"},{"path":"/reference/chkor_vld.html","id":null,"dir":"Reference","previous_headings":"","what":"Chk OR — chkor_vld","title":"Chk OR — chkor_vld","text":"Chk ","code":""},{"path":"/reference/chkor_vld.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Chk OR — chkor_vld","text":"","code":"chkor_vld(...)"},{"path":"/reference/chkor_vld.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Chk OR — chkor_vld","text":"... Multiple vld_ calls. common mistake pass chk_ calls. chkor_vld() relatively slow. possible use chk_null_or() first test using individual vld_ functions call chkor_vld() generate informative error message.","code":""},{"path":"/reference/chkor_vld.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Chk OR — chkor_vld","text":"informative error test fails.","code":""},{"path":[]},{"path":"/reference/chkor_vld.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Chk OR — chkor_vld","text":"","code":"chkor_vld() chkor_vld(vld_flag(TRUE)) try(chkor_vld(vld_flag(1))) #> Error in chkor_vld(vld_flag(1)) : `1` must be a flag (TRUE or FALSE). try(chkor_vld(vld_flag(1), vld_flag(2))) #> Error in chkor_vld(vld_flag(1), vld_flag(2)) : #> At least one of the following conditions must be met: #> * `1` must be a flag (TRUE or FALSE). #> * `2` must be a flag (TRUE or FALSE). chkor_vld(vld_flag(1), vld_flag(TRUE))"},{"path":"/reference/deparse_backtick_chk.html","id":null,"dir":"Reference","previous_headings":"","what":"Deparse Backtick — deparse_backtick_chk","title":"Deparse Backtick — deparse_backtick_chk","text":"deparse_backtick_chk wrapper deparse() backtick_chk.","code":""},{"path":"/reference/deparse_backtick_chk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Deparse Backtick — deparse_backtick_chk","text":"","code":"deparse_backtick_chk(x) backtick_chk(x) unbacktick_chk(x)"},{"path":"/reference/deparse_backtick_chk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Deparse Backtick — deparse_backtick_chk","text":"x substituted object deparse.","code":""},{"path":"/reference/deparse_backtick_chk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Deparse Backtick — deparse_backtick_chk","text":"string backticked substituted object.","code":""},{"path":"/reference/deparse_backtick_chk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Deparse Backtick — deparse_backtick_chk","text":"exported allow users easily construct chk_ functions.","code":""},{"path":"/reference/deparse_backtick_chk.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Deparse Backtick — deparse_backtick_chk","text":"backtick_chk(): Backtick unbacktick_chk(): Unbacktick","code":""},{"path":[]},{"path":"/reference/deparse_backtick_chk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Deparse Backtick — deparse_backtick_chk","text":"","code":"# deparse_backtick_chk deparse_backtick_chk(2) #> [1] \"`2`\" deparse_backtick_chk(2^2) #> [1] \"`4`\""},{"path":"/reference/err.html","id":null,"dir":"Reference","previous_headings":"","what":"Stop, Warning and Message Messages — err","title":"Stop, Warning and Message Messages — err","text":"functions call message_chk() process message rlang::abort(), rlang::warn() rlang::inform(), respectively.","code":""},{"path":"/reference/err.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Stop, Warning and Message Messages — err","text":"","code":"err( ..., n = NULL, tidy = TRUE, .subclass = NULL, class = NULL, call = rlang::caller_call(3) ) wrn(..., n = NULL, tidy = TRUE, .subclass = NULL, class = NULL) msg(..., n = NULL, tidy = TRUE, .subclass = NULL, class = NULL)"},{"path":"/reference/err.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Stop, Warning and Message Messages — err","text":"... zero objects can coerced character (pasted together separator) single condition object. n value n converting sprintf-like types. tidy flag specifying whether capitalize first character add missing period. .subclass string class error message. class Subclass condition. call execution environment currently running function, e.g. call = caller_env(). corresponding function call retrieved mentioned error messages source error. need supply call throwing condition helper function relevant mention message. Can also NULL defused function call respectively display call hard-code code display. information error calls, see Including function calls error messages.","code":""},{"path":"/reference/err.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Stop, Warning and Message Messages — err","text":"user can set subclass.","code":""},{"path":"/reference/err.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Stop, Warning and Message Messages — err","text":"err(): Error wrn(): Warning msg(): Message","code":""},{"path":"/reference/err.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Stop, Warning and Message Messages — err","text":"","code":"# err try(err(\"there %r %n problem value%s\", n = 2)) #> Error in eval_with_user_handlers(expr, envir, enclos, user_handlers) : #> There are 2 problem values. # wrn wrn(\"there %r %n problem value%s\", n = 2) #> Warning: There are 2 problem values. # msg msg(\"there %r %n problem value%s\", n = 2) #> There are 2 problem values."},{"path":"/reference/expect_chk_error.html","id":null,"dir":"Reference","previous_headings":"","what":"Expect Chk Error — expect_chk_error","title":"Expect Chk Error — expect_chk_error","text":"expect_chk_error() checks code throws error class \"chk_error\" message matches regexp. See details.","code":""},{"path":"/reference/expect_chk_error.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Expect Chk Error — expect_chk_error","text":"","code":"expect_chk_error( object, regexp = NULL, ..., info = NULL, label = NULL, class = NULL )"},{"path":"/reference/expect_chk_error.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Expect Chk Error — expect_chk_error","text":"object Object test. Supports limited unquoting make easier generate readable failures within function loop. See quasi_label details. regexp Regular expression test . character vector giving regular expression must match error message. NULL, default, asserts error, test specific value. NA, asserts errors, now recommend using expect_no_error() friends instead. Note use message errors/warnings/messages generate. Avoid tests rely specific text generated another package since can easily change. need test text generated another package, either protect test skip_on_cran() use expect_snapshot(). ... Arguments passed expect_match fixed TRUE, treats regexp string matched exactly (regular expressions). Overrides perl. perl logical. Perl-compatible regexps used? info Extra information included message. argument soft-deprecated used new code. Instead see alternatives quasi_label. label Used customise failure messages. expert use . class Must NULL.","code":""},{"path":"/reference/expect_chk_error.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Expect Chk Error — expect_chk_error","text":"regexp = NA, value first argument; otherwise captured condition.","code":""},{"path":"/reference/expect_chk_error.html","id":"testing-message-vs-class","dir":"Reference","previous_headings":"","what":"Testing message vs class","title":"Expect Chk Error — expect_chk_error","text":"checking code generates error, important check error one expect. two ways . first way simplest: just provide regexp match fragment error message. easy, fragile, test fail error message changes (even error). robust way test class error, one. can learn custom conditions https://adv-r.hadley.nz/conditions.html#custom-conditions, short, errors S3 classes can generate custom class check using class instead regexp. using expect_error() check error message formatted way makes sense human, recommend using expect_snapshot() instead.","code":""},{"path":[]},{"path":"/reference/expect_chk_error.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Expect Chk Error — expect_chk_error","text":"","code":"expect_chk_error(chk_true(FALSE)) try(expect_chk_error(chk_false(FALSE))) #> Error : `object` did not throw the expected error."},{"path":"/reference/message_chk.html","id":null,"dir":"Reference","previous_headings":"","what":"Construct Tidyverse Style Message — message_chk","title":"Construct Tidyverse Style Message — message_chk","text":"tidy = TRUE constructs tidyverse style message ","code":""},{"path":"/reference/message_chk.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Construct Tidyverse Style Message — message_chk","text":"","code":"message_chk(..., n = NULL, tidy = TRUE)"},{"path":"/reference/message_chk.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Construct Tidyverse Style Message — message_chk","text":"... Multiple objects converted string using paste0(..., collapse = ''). n value n converting sprintf-like types. tidy flag specifying whether capitalize first character add missing period.","code":""},{"path":"/reference/message_chk.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Construct Tidyverse Style Message — message_chk","text":"string message.","code":""},{"path":"/reference/message_chk.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Construct Tidyverse Style Message — message_chk","text":"Capitalizing first character possible. Adding trailing . missing. Also n != NULL replaces recognized sprintf-like types.","code":""},{"path":"/reference/message_chk.html","id":"sprintf-like-types","dir":"Reference","previous_headings":"","what":"sprintf-like types","title":"Construct Tidyverse Style Message — message_chk","text":"following recognized sprintf-like types can used message: n value n. s '' n == 1 otherwise 's' r '' n == 1 otherwise '' y 'y' n == 1 otherwise 'ie'","code":""},{"path":"/reference/message_chk.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Construct Tidyverse Style Message — message_chk","text":"","code":"message_chk(\"there %r %n\", \" problem director%y%s\") #> [1] \"There %r %n problem director%y%s.\" message_chk(\"there %r %n\", \" problem director%y%s\", n = 1) #> [1] \"There is 1 problem directory.\" message_chk(\"There %r %n\", \" problem director%y%s.\", n = 3) #> [1] \"There are 3 problem directories.\""},{"path":"/reference/p.html","id":null,"dir":"Reference","previous_headings":"","what":"Concatenate Strings — p","title":"Concatenate Strings — p","text":"wrapper base::paste().","code":""},{"path":"/reference/p.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Concatenate Strings — p","text":"","code":"p(..., sep = \" \", collapse = NULL) p0(..., collapse = NULL)"},{"path":"/reference/p.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Concatenate Strings — p","text":"... one R objects, converted character vectors. sep character string separate terms. NA_character_. collapse optional character string separate results. NA_character_.","code":""},{"path":"/reference/p.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Concatenate Strings — p","text":"character vector.","code":""},{"path":"/reference/p.html","id":"functions","dir":"Reference","previous_headings":"","what":"Functions","title":"Concatenate Strings — p","text":"p0(): wrapper base::paste0()","code":""},{"path":"/reference/p.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Concatenate Strings — p","text":"","code":"p(\"a\", \"b\") #> [1] \"a b\" p(c(\"a\", \"b\"), collapse = \" \") #> [1] \"a b\" p0(\"a\", \"b\") #> [1] \"ab\" p0(c(\"a\", \"b\"), collapse = \"\") #> [1] \"ab\""},{"path":"/reference/params.html","id":null,"dir":"Reference","previous_headings":"","what":"Parameters for chk functions — params","title":"Parameters for chk functions — params","text":"Descriptions parameters return values chk functions","code":""},{"path":"/reference/params.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Parameters for chk functions — params","text":"x object check. x_name string name object x NULL. y object check . chk flag specifying whether check parameters. chk_fun chk_ function. tolerance non-negative numeric scalar. ext character vector permitted file extensions (without .). exists flag specifying whether files/directories must (must ) exist. value non-missing scalar value. range non-missing sorted vector length 2 lower upper permitted values. inclusive flag specifying whether range exclusive. regexp string regular expression. values vector permitted values. class string specifying class. length count length. upper count max length. formals count number formal arguments. incomparables vector values compared. FALSE means values can compared. character vector specifying column names join x y . named names corresponding columns x. exclusive flag specifying whether x must include columns named values. order flag specifying whether order columns x must match names values. nrow flag whole numeric vector value, value range possible values. key character vector columns represent unique key. vld_fun vld_ function. ... Additional arguments.","code":""},{"path":"/reference/params.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Parameters for chk functions — params","text":"chk_ function throws informative error test fails returns original object successful can used pipes. vld_ function returns flag indicating whether test met.","code":""},{"path":"/news/index.html","id":"chk-091","dir":"Changelog","previous_headings":"","what":"chk 0.9.1","title":"chk 0.9.1","text":"Fixes incorrect error message chk_null_or() vld = chk::vld_xx.","code":""},{"path":"/news/index.html","id":"chk-090","dir":"Changelog","previous_headings":"","what":"chk 0.9.0","title":"chk 0.9.0","text":"CRAN release: 2023-05-27 Added chk_compatible_lengths() vld_compatible_lengths() check lengths objects ‘strictly recyclable’. Added inclusive = TRUE argument chk_range(). Added upper argument chk_length(). vld_sorted() chk_sorted() now ignore missing values. Soft deprecated .subclass class argument err(), wrn() msg().","code":""},{"path":"/news/index.html","id":"chk-081","dir":"Changelog","previous_headings":"","what":"chk 0.8.1","title":"chk 0.8.1","text":"CRAN release: 2022-08-26 Fixed bug wherecheck_key() failing sf objects.","code":""},{"path":"/news/index.html","id":"chk-080","dir":"Changelog","previous_headings":"","what":"chk 0.8.0","title":"chk 0.8.0","text":"CRAN release: 2022-02-05 Updated deprecated argument .subclass class rlang function calls Added chk_valid_name(). Fixed chk_join() sf data frames.","code":""},{"path":"/news/index.html","id":"chk-070","dir":"Changelog","previous_headings":"","what":"chk 0.7.0","title":"chk 0.7.0","text":"CRAN release: 2021-09-03","code":""},{"path":"/news/index.html","id":"added-0-7-0","dir":"Changelog","previous_headings":"","what":"Added","title":"chk 0.7.0","text":"Added chkor_vld() faster replacement soft-deprecated chkor(). Sped chk_null_or() soft-deprecating chk argument vld argument. Un-deprecated chk_count() chk_length() useful. Updated error messages precede objects described class ‘y object class’.","code":""},{"path":"/news/index.html","id":"fixed-0-7-0","dir":"Changelog","previous_headings":"","what":"Fixed","title":"chk 0.7.0","text":"chk_null_or() now returns (invisible) x.","code":""},{"path":"/news/index.html","id":"deprecated-0-7-0","dir":"Changelog","previous_headings":"","what":"Deprecated","title":"chk 0.7.0","text":"Soft deprecated chkor() chkor_vld() slow. Soft deprecated chk argument chk_null_or() vld argument. Soft deprecated chk_chr(), chk_dbl() chk_wnum() vld_ equivalents. Warn deprecated chk_count(), chk_dirs(), chk_files(), chk_has(), chk_in(), chk_length(), chk_no_missing(), vld_no_missing(), chk_proportion() Stop deprecated chk_off(), chk_on(), is_chk_on(),","code":""},{"path":"/news/index.html","id":"chk-060","dir":"Changelog","previous_headings":"","what":"chk 0.6.0","title":"chk 0.6.0","text":"CRAN release: 2021-07-04 chk_xx() functions now return invisible copy x (passes check). Fixed bug check_key() check_data() key undefined sfobjects. chk_whole_numeric() now accepts Inf values. Removed LazyData: true DESCRIPTION file avoid CRAN check note.","code":""},{"path":"/news/index.html","id":"chk-050","dir":"Changelog","previous_headings":"","what":"chk 0.5.0","title":"chk 0.5.0","text":"CRAN release: 2020-05-29 Added chk_null_or(). Added chk_wnum() check whole numeric scalars. Added chk_dbl() check double scalars. Added chk_chr() check character scalars. Added chk_not_subset() check subset. Added chk_factor() check factor vector. Added chk_character_or_factor() factor character vector. Added check_files() check_dirs() check files directories exist (). Added chk_setordered() check order elements set. check_values() now checks factor levels. Undeprecated chk_is() useful R6 objects. Soft-deprecated chk_datetime() chk_date_time().","code":""},{"path":"/news/index.html","id":"chk-040","dir":"Changelog","previous_headings":"","what":"chk 0.4.0","title":"chk 0.4.0","text":"CRAN release: 2020-03-04 check_names(). check_dim(). check_values(). check_key(). check_data(). chk_logical() vld_logical(). chk_double() vld_double(). chk_integer() vld_integer(). chk_character() vld_character(). chk_data() vld_data(). chk_join(). chk_vector() vld_vector() ignores attributes.","code":""},{"path":"/news/index.html","id":"chk-031","dir":"Changelog","previous_headings":"","what":"chk 0.3.1","title":"chk 0.3.1","text":"CRAN release: 2020-02-05 Added expect_chk_error(). Added chk_matrix() vld_matrix(). Added chk_array() vld_array(). abort_chk now allows original arguments attached. Added chk_tz() vld_tz(). Added chk_matrix() vld_matrix(). Added chk_array() vld_array(). Added expect_chk_error().","code":""},{"path":"/news/index.html","id":"chk-030","dir":"Changelog","previous_headings":"","what":"chk 0.3.0","title":"chk 0.3.0","text":"CRAN release: 2020-01-15 Added chk_sorted() vld_sorted().","code":""},{"path":"/news/index.html","id":"chk-021","dir":"Changelog","previous_headings":"","what":"chk 0.2.1","title":"chk 0.2.1","text":"CRAN release: 2019-11-26","code":""},{"path":"/news/index.html","id":"minor-changes-0-2-1","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"chk 0.2.1","text":"Removed chk-benchmarking.Rmd vignette causing problems many CRAN checks.","code":""},{"path":"/news/index.html","id":"chk-020","dir":"Changelog","previous_headings":"","what":"chk 0.2.0","title":"chk 0.2.0","text":"CRAN release: 2019-11-15","code":""},{"path":"/news/index.html","id":"major-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Major Changes","title":"chk 0.2.0","text":"Added x_name = NULL argument relevant chk_ functions. Replaced err = FALSE variant vld_ variant. Switched stop(), warning() message() rlang variants abort(), warn() inform(). error messages now start x_name. Err capitalizes first character adds missing period (tidyverse style).","code":""},{"path":"/news/index.html","id":"new-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"New Functions","title":"chk 0.2.0","text":"chk_all() chk_atomic() chk_environment() chk_ext() chk_has() chk_not_empty() chk_s3_class() chk_s4_class() chk_setequal()","code":""},{"path":"/news/index.html","id":"newly-exported-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"Newly Exported Functions","title":"chk 0.2.0","text":"backtick_chk() unbacktick_chk().","code":""},{"path":"/news/index.html","id":"new-arguments-0-2-0","dir":"Changelog","previous_headings":"","what":"New Arguments","title":"chk 0.2.0","text":"formals argument chk_function(). tidy = TRUE argument errors, warnings messages. n = NULL call. = FALSE args error message generating functions. ellipsis = 10L argument cc(). sep = \", \" arg cc(). incomparables = FALSE argument chk_unique(). %y sprintf-like types.","code":""},{"path":"/news/index.html","id":"soft-deprecated-functions-0-2-0","dir":"Changelog","previous_headings":"","what":"(Soft) Deprecated Functions","title":"chk 0.2.0","text":"chk_no_missing() chk_not_any_na(). chk_files() chk_dirs() chk_all(x, chk_file) etc. deparse_backtick() deparse_backtick_chk(). chk_length(), chk_proportion() chk_count(). chk_on(), chk_off() is_chk_on().","code":""},{"path":"/news/index.html","id":"minor-changes-0-2-0","dir":"Changelog","previous_headings":"","what":"Minor Changes","title":"chk 0.2.0","text":"Changed chk_match() ignores missing values. Changed chk_true() (chk_false()) behavior isTRUE R >= 3.5. Extended chk_unique() handle incomparables != FALSE data frames. Changed range = c(0,1) chk_range().","code":""},{"path":"/news/index.html","id":"chk-001","dir":"Changelog","previous_headings":"","what":"chk 0.0.1","title":"chk 0.0.1","text":"Initial release.","code":""}]