Check if an object does not contain prohibited elements — excludes_advanced • assertions
+x must be the same type as illegal.
+Factors are treated as character vectors.">
Skip to contents
@@ -40,7 +42,8 @@
This function checks that x does not include any of the illegal elements.
-x must be the same type as illegal.
+x must be the same type as illegal.
+Factors are treated as character vectors.
diff --git a/reference/includes_advanced.html b/reference/includes_advanced.html
index 15309c4..dd4500b 100644
--- a/reference/includes_advanced.html
+++ b/reference/includes_advanced.html
@@ -1,7 +1,9 @@
Check if an object contains required elements — includes_advanced • assertions
+x must be the same type as required.
+Factors are treated as character vectors.">
Skip to contents
@@ -40,7 +42,8 @@
This function checks that x includes all of the required elements.
-x must be the same type as required.
+x must be the same type as required.
+Factors are treated as character vectors.
diff --git a/search.json b/search.json
index 14bf858..216045f 100644
--- a/search.json
+++ b/search.json
@@ -1 +1 @@
-[{"path":"/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 assertions authors 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":"/articles/create_custom_assertions.html","id":"getting-started","dir":"Articles","previous_headings":"","what":"Getting Started","title":"Create Custom Assertions","text":"custom assertion want use repeatedly code? create assertion functions assert_create() function! Lets start recreating assert_numeric() assertion using assert_create(): create custom assertion function, need supply two arguments assert_create(): func: function take object assert returns TRUE FALSE depending whether assertion pass fail. default_error_msg: character string providing error message case assertion fails. string can include special termss : {arg_name} refer name variable checked {arg_value} refer value variable. {code_to_evaluate} evaluate code within error message. Customise ‘code_to_evaluate’. e.g {class(arg_name)} {.strong bold_text} perform inline formatting. Customise ‘bold_text’","code":"# Load library library(assertions) # Create a function that asserts input is numeric assert_numeric_2 <- assert_create( func = is.numeric, # Returns TRUE/FALSE for assertion PASS/FAIL default_error_msg = \"'{arg_name}' must be of type numeric, not {class(arg_value)}\" ) # Assertion passes if input is numeric assert_numeric_2(123) # But throws the expected error if input is not numeric assert_numeric_2(\"abc\")"},{"path":"/articles/create_custom_assertions.html","id":"advanced-assertions","dir":"Articles","previous_headings":"","what":"Advanced Assertions","title":"Create Custom Assertions","text":"Problem: Sometimes necessary perform several assertions single object, return error messages specific mode failure. cases, can useful chain together series different assertions object. Solution: assert_create_chain() function allows combine multiple assertion functions created assert_create() single assertion. wrapped assertions evaluated order supplied, assertions fail, appropriate error message returned. Example ’s example use assert_create_chain() create assertion function asserts input string individually asserting Input ‘character’ type Input length 1","code":"assert_string <- assert_create_chain( assert_create(is.character, '{arg_name} must be a character, not {class(arg_value)}'), assert_create(function(s){ length(s)==1 }, '{arg_name} must be length 1, not {arg_value}') ) # Assert String assert_string(\"String\") assert_string(3) # Output: Error: '3' must be a character"},{"path":"/articles/create_custom_assertions.html","id":"more-advanced-assertions","dir":"Articles","previous_headings":"","what":"More Advanced Assertions","title":"Create Custom Assertions","text":"Problem: often need error messages vary significantly based input. Solution cases, convenient define error messages function pass func. work? call assert_create, instead defining default_error_msg, can design func return string assertion fail. string become error message. returning different strings upon different failure conditions, can produce diverse error messages easily. Example ’s recreation example , using func supplies strings indicate assertion failure Additional Notes Note error strings can use special terms {arg_name}, access first argument using original name (e.g. {object}, example ). assert_create changes first arguments name. Values arguments can referred string using {name_of_nonfirst_argument}","code":"# Define Function is_a_string <- function(object){ if(!is.character(object)) return(\"{arg_name} must be a character, not {class(arg_value)}\") if(length(object) != 1){ return(\"{arg_name} must be length 1, not {length(object)}\") } return(TRUE) } # Create Assertion assert_is_string <- assert_create( is_a_string ) # Test assertion works assert_is_string(\"String\") assert_is_string(3) # 3 must be a character, not numeric assert_is_string(c(\"A\", \"B\"))"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Sam El-Kamand. Author, maintainer, copyright holder.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"El-Kamand S (2024). assertions: Simple Assertions Beautiful Customisable Error Messages. R package version 0.1.0.9000, https://selkamand.github.io/assertions/, https://github.com/selkamand/assertions.","code":"@Manual{, title = {assertions: Simple Assertions for Beautiful and Customisable Error Messages}, author = {Sam El-Kamand}, year = {2024}, note = {R package version 0.1.0.9000, https://selkamand.github.io/assertions/}, url = {https://github.com/selkamand/assertions}, }"},{"path":"/index.html","id":"assertions-","dir":"","previous_headings":"","what":"Simple Assertions for Beautiful and Customisable Error Messages","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Simple assertions sensible defaults customisable error messages.","code":""},{"path":"/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"goals assertions provide Convenient assertion calls (e.g. assert_number()) general assert function asserts possible condition/s throws informative error messages Extremely user friendly error message defaults. Easily customisable error messages, inline code evaluation & styling powered cli package Simple creation custom assertion functions user-specified defaults","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"","code":"install.packages(\"assertions\")"},{"path":"/index.html","id":"development-version","dir":"","previous_headings":"Installation","what":"Development version","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"get bug fix use feature development version, can install development version assertions GitHub.","code":"# install.packages('remotes') remotes::install_github('selkamand/assertions')"},{"path":"/index.html","id":"quick-start","dir":"","previous_headings":"","what":"Quick Start","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"assertions start assert, means just type levarage autocomplete suggestions look available options","code":"# Load library library(assertions) # Use premade assertions assert_character(c('a', 'b', 'c')) assert_number(2) assert_flag(TRUE) # Assert anything assert(1000 % 2 == 0) # Assert multiple conditions at once (all must be true) assert(1000 % 2 == 0, 6/2 == 3)"},{"path":"/index.html","id":"customizing-error-messages","dir":"","previous_headings":"","what":"Customizing Error Messages","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"advanced customisation, see cli documentation","code":"# Customise any error messages using the `msg` argument assert_number(\"A\", msg = \"Please supply a number!\") # Evaluate code in your error message using '{}' operators foo = \"A\" assert_number(foo, msg = \"'{foo}' is not a number :(. Try again\") # Emphasise cetain words in error using {.strong text_to_emphasise} assert_number(\"A\", msg = \"{.strong Try again}\")"},{"path":"/index.html","id":"create-your-own-assertion-functions","dir":"","previous_headings":"","what":"Create your own assertion functions","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"custom assertion want use repeatedly? Creating assertion functions extremely easy Just use assert_create(), just need supply: function returns TRUE/FALSE assertion PASS/FAIL default error message example? See ?assert_create() details","code":"# Create a function that asserts input is lowercase assert_lowercase <- assert_create( func = function(x) {x == tolower(x)}, default_error_msg = \"'{arg_name}' must be entirely lowercase\" ) #Assertion passes if input is lowercase assert_lowercase(\"all lower case\") #But throws the expected error if uppercase characters are present assert_lowercase(\"NOT all lower case\")"},{"path":"/index.html","id":"vectorised-assertions","dir":"","previous_headings":"","what":"Vectorised assertions","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Assertions may vectorised versions test whether elements vector/matrix meet condition. example: assert_greater_than() expects single number input assert_all_greater_than() works vectors/matrices. Vectorised functions assert_all_ prefix.","code":""},{"path":"/index.html","id":"contributing-to-this-package","dir":"","previous_headings":"","what":"Contributing to this package","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Two options","code":""},{"path":"/index.html","id":"request-an-assertion","dir":"","previous_headings":"Contributing to this package","what":"Request an assertion","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Open github issue request away. ’m happy implement tonne assertions, just let know want","code":""},{"path":"/index.html","id":"creating-assertions-yourself","dir":"","previous_headings":"Contributing to this package","what":"Creating assertions yourself","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Create custom assert_something function call assert_create() assert_create_chain() Create github issue assertion creation code + helper function pass func argument (e.g. is_something())","code":""},{"path":"/index.html","id":"similar-packages","dir":"","previous_headings":"","what":"Similar Packages","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Great alternative packages writing assertions include: assertthat checkmate assertive ensurer package features syntax. hopefully one suits needs preferences. ’m big fan checkmate speed, assertive huge library ready-made assertion functions, assertthat error message customization.","code":""},{"path":"/reference/assert.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that conditions are met — assert","title":"Assert that conditions are met — assert","text":"Assert conditions met","code":""},{"path":"/reference/assert.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that conditions are met — assert","text":"","code":"assert(..., msg = NULL, call = rlang::caller_env())"},{"path":"/reference/assert.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that conditions are met — assert","text":"... list conditions check msg character string containing error message display conditions met. string can include placeholder {failed_expressions} insert list failed expressions. string can also include {?s} {?/} insert correct pluralization list failed expressions. call relevant pooling assertions multi-assertion helper functions. See cli_abort details.","code":""},{"path":"/reference/assert.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that conditions are met — assert","text":"invisible(TRUE) conditions met, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that conditions are met — assert","text":"","code":"try({ assert(1 == 1) # Passes assert(2 == 2, 3 == 3) # Passes assert(2 == 1, 3 == 3) # Throws default error assert(2 == 1, 3 == 3, msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : The following assertions failed: #> ✖ `2 == 1`"},{"path":"/reference/assert_all_directories_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert all files are directories — assert_all_directories_exist","title":"Assert all files are directories — assert_all_directories_exist","text":"Assert paths supplied exist directories. assert single directory exists, see assert_directory_exists()","code":""},{"path":"/reference/assert_all_directories_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert all files are directories — assert_all_directories_exist","text":"","code":"assert_all_directories_exist( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_directories_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert all files are directories — assert_all_directories_exist","text":"x Paths directories (character) msg character string containing error message file x exist call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_directories_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert all files are directories — assert_all_directories_exist","text":"invisible(TRUE) x exists directory, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_directories_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert all files are directories — assert_all_directories_exist","text":"","code":"try({ assert_directory(system.file(\"package = assertions\")) # PASSES assert_directory(\"foo\") # Throws Error }) #> Error in assert_directory(system.file(\"package = assertions\")) : #> could not find function \"assert_directory\""},{"path":"/reference/assert_all_files_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that all files exist — assert_all_files_exist","title":"Assert that all files exist — assert_all_files_exist","text":"Assert files vector exist. assert single file exists, see assert_file_exists()","code":""},{"path":"/reference/assert_all_files_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that all files exist — assert_all_files_exist","text":"","code":"assert_all_files_exist( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_files_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that all files exist — assert_all_files_exist","text":"x Paths files (character) msg character string containing error message files x exist call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_files_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that all files exist — assert_all_files_exist","text":"invisible(TRUE) files x exist, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_files_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that all files exist — assert_all_files_exist","text":"","code":"real_file <- system.file(\"DESCRIPTION\", package = \"assertions\") try({ assert_all_files_exist(c(real_file, real_file)) assert_all_files_exist(c(\"foo\", \"bar\")) # Throws Error }) #> Error in eval(expr, envir) : #> Failed to find files: foo and bar"},{"path":"/reference/assert_all_files_have_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert file extensions — assert_all_files_have_extension","title":"Assert file extensions — assert_all_files_have_extension","text":"Assert filepaths supplied one selected extensions. require file actually exist.","code":""},{"path":"/reference/assert_all_files_have_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert file extensions — assert_all_files_have_extension","text":"","code":"assert_all_files_have_extension( x, extensions, compression = FALSE, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_files_have_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert file extensions — assert_all_files_have_extension","text":"x object extensions valid extensions (character vector). include '.', e.g. supply extensions = 'txt' extensions = '.txt' compression compression extension ‘.gz’, ‘.bz2’ ‘.xz’ removed first? msg character string containing error message file x specified extensions call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_files_have_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert file extensions — assert_all_files_have_extension","text":"invisible(TRUE) x specified extensions, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_files_have_extension.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert file extensions — assert_all_files_have_extension","text":"","code":"try({ assert_all_files_have_extension(c(\"foo.txt\", \"bar.txt\"), extensions = \"txt\") # Passes assert_all_files_have_extension(c(\"foo.txt\", \"bar.csv\"), extensions = \"csv\") # Throws Error }) #> Error in eval(expr, envir) : #> 'c(\"foo.txt\", \"bar.csv\")' has an invalid extension (required #> extension/s: csv). The following file has an unexpected extension: [foo.txt]"},{"path":"/reference/assert_all_greater_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is greater than a specified minimum value — assert_all_greater_than","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"Assert elements numeric vector/matrix minimum value.","code":""},{"path":"/reference/assert_all_greater_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"","code":"assert_all_greater_than( x, minimum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_greater_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"x object check minimum minimum value compare (number) msg character string containing error message display x greater specified minimum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_greater_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"invisible(TRUE) x greater specified minimum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_greater_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"","code":"try({ assert_all_greater_than(3, 2) # Passes assert_all_greater_than(c(2,3,4), 1) # Passes assert_all_greater_than(c(2,3,4), 2) # Passes assert_all_greater_than(c(2,3,1), 3) # Throws default error assert_all_greater_than(c(2,3,1), 3, msg = \"custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> c(2, 3, 4) must all be greater than `2`."},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"Assert elements numeric vector/matrix minimum value.","code":""},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"","code":"assert_all_greater_than_or_equal_to( x, minimum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"x object check minimum minimum value compare msg character string containing error message display x greater equal specified minimum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"invisible(TRUE) x greater equal specified minimum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"","code":"try({ assert_greater_than_or_equal_to(3, 2) # Passes assert_greater_than_or_equal_to(c(3, 4, 5), 2) # Passes assert_greater_than_or_equal_to(2, 3) # Throws error }) #> Error in eval(expr, envir) : #> 'c(3, 4, 5)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_all_less_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is less than a specified maximum value — assert_all_less_than","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"Assert elements numeric vector/matrix maximum value.","code":""},{"path":"/reference/assert_all_less_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"","code":"assert_all_less_than( x, maximum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_less_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"x object check maximum maximum value compare (number) msg character string containing error message display x less specified maximum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_less_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"invisible(TRUE) x less specified maximum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_less_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"","code":"try({ assert_all_less_than(1, 2) # Passes assert_all_less_than(c(1,2,3), 4) # Passes assert_all_less_than(c(1,2,3), 2) # Throws default error assert_all_less_than(c(1,2,3), 2, msg = \"custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> c(1, 2, 3) must all be less than `2`."},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"Assert elements numeric vector/matrix equal maximum value.","code":""},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"","code":"assert_all_less_than_or_equal_to( x, maximum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"x object check maximum maximum value compare msg character string containing error message display x less equal specified maximum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"invisible(TRUE) x less equal specified maximum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"","code":"try({ assert_less_than_or_equal_to(1, 2) # Passes assert_less_than_or_equal_to(c(1, 2, 3), 3) # Passes assert_less_than_or_equal_to(3, 2) # Throws error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_character.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a character vector — assert_character","title":"Assert input is a character vector — assert_character","text":"Assert R object 'character' type. Works vector matrix objects. assert object specifically character vector see assert_character_vector()","code":""},{"path":"/reference/assert_character.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a character vector — assert_character","text":"","code":"assert_character(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_character.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a character vector — assert_character","text":"x object msg character string containing error message display x character vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_character.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a character vector — assert_character","text":"invisible(TRUE) x character vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_character.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a character vector — assert_character","text":"","code":"try({ assert_character(\"a\") # Passes assert_character(\"a\") # Passes assert_character(c(\"a\", \"b\", \"c\")) # Passes assert_character(matrix(c('A', 'B', 'C', 'D'))) # Passes assert_character(1:3) # Throws default error assert_character(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> '1:3' must be a character, not a integer"},{"path":"/reference/assert_character_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a character vector — assert_character_vector","title":"Assert input is a character vector — assert_character_vector","text":"Assert object character vector. Length 1 character vectors (strings) considered vectors.","code":""},{"path":"/reference/assert_character_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a character vector — assert_character_vector","text":"","code":"assert_character_vector( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_character_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a character vector — assert_character_vector","text":"x object msg character string containing error message display x character vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_character_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a character vector — assert_character_vector","text":"invisible(TRUE) x character vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_character_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a character vector — assert_character_vector","text":"","code":"try({ assert_character_vector(c(\"a\", \"b\", \"c\")) # Passes assert_character_vector(c(\"a\", 1, \"b\")) # Throws default error assert_character_vector(matrix(c('A', 'B', 'C', 'D'))) # Throws error since type = matrix assert_character_vector(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error assert_character_vector(glue::glue('A')) # Throws error }) #> Error in eval(expr, envir) : #> 'matrix(c(\"A\", \"B\", \"C\", \"D\"))' must be a character vector, not a matrix #> and array"},{"path":"/reference/assert_character_vector_or_glue.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"Assert object character vector (glue vector). Length 1 character vectors (strings) considered vectors.","code":""},{"path":"/reference/assert_character_vector_or_glue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"","code":"assert_character_vector_or_glue( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_character_vector_or_glue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"x object msg character string containing error message display x character vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_character_vector_or_glue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"invisible(TRUE) x character vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_character_vector_or_glue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"","code":"try({ assert_character_vector_or_glue(c(\"a\", \"b\", \"c\")) # Passes assert_character_vector_or_glue(glue::glue('A')) # Passes assert_character_vector_or_glue(c(\"a\", 1, \"b\")) # Throws default error assert_character_vector_or_glue(matrix(c('A', 'B', 'C', 'D'))) # Throws error since type = matrix assert_character_vector_or_glue(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'matrix(c(\"A\", \"B\", \"C\", \"D\"))' must be a character vector, not a matrix #> and array"},{"path":"/reference/assert_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert object belongs to class — assert_class","title":"Assert object belongs to class — assert_class","text":"function asserts input object belongs class","code":""},{"path":"/reference/assert_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert object belongs to class — assert_class","text":"","code":"assert_class(x, class, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert object belongs to class — assert_class","text":"x input object class checks x belongs class. multiple values class supplied, returns whether x belongs (character) msg character string containing error message display x belong class call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert object belongs to class — assert_class","text":"invisible(TRUE) x belongs class, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert object belongs to class — assert_class","text":"","code":"try({ assert_has_class(1, \"numeric\") # Passes assert_has_class(1, \"character\") # Throws default error }) #> Error in assert_has_class(1, \"numeric\") : #> could not find function \"assert_has_class\""},{"path":"/reference/assert_connection.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a database connection — assert_connection","title":"Assert input is a database connection — assert_connection","text":"Assert input object database connection, specifically \"DBIConnection\" class, standard virtual class used DBI package database connections. Note assertion test database connection valid /active.","code":""},{"path":"/reference/assert_connection.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a database connection — assert_connection","text":"","code":"assert_connection(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_connection.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a database connection — assert_connection","text":"x object assert database connection msg custom error message displayed x valid database connection. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_connection.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a database connection — assert_connection","text":"invisible(TRUE) x valid database connection, otherwise aborts error message.","code":""},{"path":"/reference/assert_connection.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Assert input is a database connection — assert_connection","text":"function designed use objects inheriting \"DBIConnection\" class, used widely across database connection implementations R. database interface packages introduced, additional checks may added support connection classes.","code":""},{"path":"/reference/assert_connection.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a database connection — assert_connection","text":"","code":"try({ # Assuming a valid DBI connection `conn`: assert_connection(conn) # Passes if `conn` is a DBI connection assert_connection(42) # Fails with error message }) #> Error in eval(match.call()[[2]], envir = call) : object 'conn' not found"},{"path":"/reference/assert_create.html","id":null,"dir":"Reference","previous_headings":"","what":"Create an assertion function — assert_create","title":"Create an assertion function — assert_create","text":"function creates assertion function can used check validity input. assertions provided package created using either assert_create() assert_create_chain()","code":""},{"path":"/reference/assert_create.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create an assertion function — assert_create","text":"","code":"assert_create(func, default_error_msg = NULL)"},{"path":"/reference/assert_create.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create an assertion function — assert_create","text":"func function defining assertion criteria. function return logical value (TRUE assertion passed FALSE fails). Alternatively, instead returning FALSE, can return string act error message. latter case, need supply default_error_msg default_error_msg character string providing error message case assertion fails. Must supplied function func returns FALSE assertion fails (opposed string) Can include following special terms {arg_name} refer name variable supplied assertion. {arg_value} refer value variable supplied assertion {code_to_evaluate} evaluate code within error message. Replace code_to_evaluate code {.strong bold_text} perform inline formatting. Replace bold_text text. See cli documentation details","code":""},{"path":"/reference/assert_create.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create an assertion function — assert_create","text":"assertion function.","code":""},{"path":"/reference/assert_create.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create an assertion function — assert_create","text":"","code":"#' # Create an assertion function that checks that a character string is all # lower case assert_character <- assert_create( is.character, \"{arg_name} must be a character vector, not a {class(arg_value)}\" ) # Use the assertion function try({ is_lower(\"hello\") # Returns invisible TRUE is_lower(\"Hello\") # Aborts the function with the error message }) #> Error in is_lower(\"hello\") : could not find function \"is_lower\""},{"path":"/reference/assert_create_chain.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Chains of Assertions — assert_create_chain","title":"Create Chains of Assertions — assert_create_chain","text":"Combine multiple assertion functions created assert_create() single assertion function diverse failure modes error messages.","code":""},{"path":"/reference/assert_create_chain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Chains of Assertions — assert_create_chain","text":"","code":"assert_create_chain(...)"},{"path":"/reference/assert_create_chain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Chains of Assertions — assert_create_chain","text":"... assertion functions created assert_create().","code":""},{"path":"/reference/assert_create_chain.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Chains of Assertions — assert_create_chain","text":"single assertion function calls input functions order supplied.","code":""},{"path":"/reference/assert_create_chain.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Chains of Assertions — assert_create_chain","text":"","code":"# Create an assertion function that checks for both positive integers and even values assert_string <- assert_create_chain( assert_create(is.character, '{{arg_name}} must be a character'), assert_create(function(x){{ length(x)==1 }}, '{{arg_name}} must be length 1') ) # Use the assertion function to check a valid value assert_string(\"String\") # Use the assertion function to check an invalid value try({ assert_string(3) # Output: Error: '3' must be a character }) #> Error in eval(expr, envir) : {arg_name} must be a character"},{"path":"/reference/assert_dataframe.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a data frame — assert_dataframe","title":"Assert input is a data frame — assert_dataframe","text":"Assert input data frame","code":""},{"path":"/reference/assert_dataframe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a data frame — assert_dataframe","text":"","code":"assert_dataframe(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_dataframe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a data frame — assert_dataframe","text":"x object msg character string containing error message display x data frame call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_dataframe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a data frame — assert_dataframe","text":"invisible(TRUE) x data frame, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_dataframe.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a data frame — assert_dataframe","text":"","code":"try({ assert_dataframe(mtcars) # Passes assert_dataframe(data.frame()) # Passes assert_dataframe(1:10) # Throws default error assert_dataframe(matrix(1:6, 2, 3)) # Throws default error assert_dataframe(c(1, 2, 3)) # Throws default error: \"Error assert_dataframe(list(a = 1, b = 2)) # Throws default error assert_dataframe(factor(c(1, 2, 3))) # Throws default error assert_dataframe(1:10, msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> '1:10' must be a data.frame, not a integer"},{"path":"/reference/assert_directory_does_not_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert a directory does not exist — assert_directory_does_not_exist","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"Assert directory already exist. Useful avoiding overwriting. function exact copy assert_file_does_not_exist() included make assertion code readable.","code":""},{"path":"/reference/assert_directory_does_not_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"","code":"assert_directory_does_not_exist( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_directory_does_not_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"x Path file (string) msg character string containing error message file x already exists call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_directory_does_not_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"invisible(TRUE) directory x already exist, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_directory_does_not_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"","code":"real_dir <- system.file(\"tests\", package = \"assertions\") try({ assert_directory_does_not_exist(\"foo\") # Passes assert_directory_does_not_exist(real_dir) # Throws error assert_directory_does_not_exist(c(\"foo\", \"bar\")) # Throws Error (single file only) }) #> Error in eval(expr, envir) : #> 'c(\"foo\", \"bar\")' is not a string! (length is 2, not 1)"},{"path":"/reference/assert_directory_exists.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert are directory exists — assert_directory_exists","title":"Assert are directory exists — assert_directory_exists","text":"Assert directory exists. assert directories vector exist, see assert_all_directories_exist()","code":""},{"path":"/reference/assert_directory_exists.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert are directory exists — assert_directory_exists","text":"","code":"assert_directory_exists( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_directory_exists.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert are directory exists — assert_directory_exists","text":"x Path directory (string) msg character string containing error message file x exist call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_directory_exists.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert are directory exists — assert_directory_exists","text":"invisible(TRUE) x exists directory, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_directory_exists.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert are directory exists — assert_directory_exists","text":"","code":"try({ assert_directory_exists(system.file(\"package = assertions\")) # PASS assert_all_directories_exist(\"foo\") # Throws Error }) #> Error in eval(expr, envir) : Failed to find directory:"},{"path":"/reference/assert_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input objects are equal — assert_equal","title":"Assert that the input objects are equal — assert_equal","text":"x equal y. powered .equal() function.","code":""},{"path":"/reference/assert_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input objects are equal — assert_equal","text":"","code":"assert_equal( x, y, tolerance = sqrt(.Machine$double.eps), check_names = TRUE, check_environment = TRUE, check_tzone = TRUE, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input objects are equal — assert_equal","text":"x object check y value compare tolerance Differences smaller tolerance reported. default value close 1.5e-8 (numeric >= 0). check_names names(.) target current compare (flag) check_environment environments functions compared? may need set check.environment=FALSE unexpected cases, comparing two nls() fits. (flag) check_tzone \"tzone\" attributes compared. Important comparing POSIXt objects. (flag) msg character string containing error message display x equal y call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input objects are equal — assert_equal","text":"invisible(TRUE) x equal specified value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input objects are equal — assert_equal","text":"","code":"try({ assert_equal(3, 3) # Passes assert_equal(c(3, 3, 3), 3, ) # Fails assert_equal(2, 3) # Throws error }) #> Error in eval(expr, envir) : #> c(3, 3, 3) must be equal to 3"},{"path":"/reference/assert_excludes.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert object does not include any illegal values — assert_excludes","title":"Assert object does not include any illegal values — assert_excludes","text":"Assert x include illegal elements","code":""},{"path":"/reference/assert_excludes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert object does not include any illegal values — assert_excludes","text":"","code":"assert_excludes( x, illegal, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_excludes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert object does not include any illegal values — assert_excludes","text":"x object illegal prohibited elements check msg character string describing error message x includes illegal elements call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_excludes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert object does not include any illegal values — assert_excludes","text":"invisible(TRUE) x includes illegal elements, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_excludes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert object does not include any illegal values — assert_excludes","text":"","code":"try({ assert_directory(system.file(\"package = assertions\")) assert_directory(\"foo\") # Throws Error }) #> Error in assert_directory(system.file(\"package = assertions\")) : #> could not find function \"assert_directory\""},{"path":"/reference/assert_factor_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a factor — assert_factor_vector","title":"Assert input is a factor — assert_factor_vector","text":"Assert R object factor. Note assert_factor function exists since R factors always vector quantities (never scalar / matrices)","code":""},{"path":"/reference/assert_factor_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a factor — assert_factor_vector","text":"","code":"assert_factor_vector( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_factor_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a factor — assert_factor_vector","text":"x object msg character string containing error message display x factor call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_factor_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a factor — assert_factor_vector","text":"invisible(TRUE) x factor, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_factor_vector.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Assert input is a factor — assert_factor_vector","text":"Technically function name misleading, since .vector(factor(1)) == FALSE since act exactly like vectors end users, think name suitable","code":""},{"path":"/reference/assert_factor_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a factor — assert_factor_vector","text":"","code":"try({ assert_factor_vector(factor(c(\"a\", \"b\", \"c\"))) # Passes assert_factor_vector(c(\"a\", \"b\", \"c\")) # Throws default error assert_factor_vector(factor(c(\"a\", \"b\", \"c\")), \"Custom error message\") # Passes assert_factor_vector(1:3, \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(\"a\", \"b\", \"c\")' must be a factor, not a character"},{"path":"/reference/assert_file_does_not_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert a file does not exist — assert_file_does_not_exist","title":"Assert a file does not exist — assert_file_does_not_exist","text":"Assert file exist. Useful avoiding overwriting.","code":""},{"path":"/reference/assert_file_does_not_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert a file does not exist — assert_file_does_not_exist","text":"","code":"assert_file_does_not_exist( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_file_does_not_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert a file does not exist — assert_file_does_not_exist","text":"x Path file (string) msg character string containing error message file x already exists call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_file_does_not_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert a file does not exist — assert_file_does_not_exist","text":"invisible(TRUE) file x exist, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_file_does_not_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert a file does not exist — assert_file_does_not_exist","text":"","code":"real_file <- system.file(\"DESCRIPTION\", package = \"assertions\") try({ assert_file_does_not_exist(\"foo\") # Passes assert_file_does_not_exist(real_file) # Throws error assert_file_does_not_exist(c(\"foo\", \"bar\")) # Throws Error (single file only) }) #> Error in eval(expr, envir) : #> File (/home/runner/work/_temp/Library/assertions/DESCRIPTION) already #> exists"},{"path":"/reference/assert_file_exists.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert a file exists — assert_file_exists","title":"Assert a file exists — assert_file_exists","text":"Assert file exists. assert files vector exist, see assert_all_files_exist()","code":""},{"path":"/reference/assert_file_exists.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert a file exists — assert_file_exists","text":"","code":"assert_file_exists(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_file_exists.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert a file exists — assert_file_exists","text":"x Path file (string) msg character string containing error message file x exist call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_file_exists.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert a file exists — assert_file_exists","text":"invisible(TRUE) file x exists, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_file_exists.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert a file exists — assert_file_exists","text":"","code":"real_file <- system.file(\"DESCRIPTION\", package = \"assertions\") try({ assert_file_exists(real_file) # PASSES assert_file_exists(\"foo\") # Throws Error assert_file_exists(c(real_file, real_file)) # Throws Error (should use assert_all_files_exist) }) #> Error in eval(expr, envir) : Failed to find file: foo"},{"path":"/reference/assert_file_has_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert file extensions — assert_file_has_extension","title":"Assert file extensions — assert_file_has_extension","text":"Assert filepath includes one selected extensions. require file actually exist.","code":""},{"path":"/reference/assert_file_has_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert file extensions — assert_file_has_extension","text":"","code":"assert_file_has_extension( x, extensions, compression = FALSE, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_file_has_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert file extensions — assert_file_has_extension","text":"x object extensions valid extensions (character vector). include '.', e.g. supply extensions = 'txt' extensions = '.txt' compression compression extension ‘.gz’, ‘.bz2’ ‘.xz’ removed first? msg character string containing error message file x specified extensions call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_file_has_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert file extensions — assert_file_has_extension","text":"invisible(TRUE) x specified extensions, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_file_has_extension.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert file extensions — assert_file_has_extension","text":"","code":"try({ assert_file_has_extension(\"foo.txt\", extensions = \"txt\") # Passes assert_file_has_extension(\"file.txt\", extensions = \"csv\") # Throws Error }) #> Error in eval(expr, envir) : #> '\"file.txt\"' has an invalid extension (required extension/s: csv). The #> following file has an unexpected extension: [file.txt]"},{"path":"/reference/assert_flag.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a scalar logical — assert_flag","title":"Assert input is a scalar logical — assert_flag","text":"Assert input flag (logical length 1: TRUE FALSE)","code":""},{"path":"/reference/assert_flag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a scalar logical — assert_flag","text":"","code":"assert_flag(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_flag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a scalar logical — assert_flag","text":"x object msg character string containing error message display x scalar logical call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_flag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a scalar logical — assert_flag","text":"invisible(TRUE) x scalar logical, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_flag.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a scalar logical — assert_flag","text":"","code":"try({ assert_flag(TRUE) # Passes assert_flag(FALSE) # Passes assert_flag(c(TRUE, FALSE)) # Throws default error assert_flag(1, \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(TRUE, FALSE)' is not a flag! (length is 2, not 1)"},{"path":"/reference/assert_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a function — assert_function","title":"Assert input is a function — assert_function","text":"Assert input function","code":""},{"path":"/reference/assert_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a function — assert_function","text":"","code":"assert_function(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a function — assert_function","text":"x object msg character string containing error message display x function call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a function — assert_function","text":"invisible(TRUE) x function, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_function.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a function — assert_function","text":"","code":"try({ # Assert that a variable is a function x <- function(a, b) { a + b } assert_function(x) # does nothing # Assert that a variable is not a function x <- \"not a function\" assert_function(x) # stops execution and prints an error message }) #> Error in eval(expr, envir) : #> 'x' must be a function, not a character"},{"path":"/reference/assert_function_expects_n_arguments.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert function expects n arguments — assert_function_expects_n_arguments","title":"Assert function expects n arguments — assert_function_expects_n_arguments","text":"Assert function expects n arguments, user control variable arguments (...) counted (default throws error)","code":""},{"path":"/reference/assert_function_expects_n_arguments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert function expects n arguments — assert_function_expects_n_arguments","text":"","code":"assert_function_expects_n_arguments( x, n, dots = c(\"throw_error\", \"count_as_0\", \"count_as_1\", \"count_as_inf\"), msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_function_expects_n_arguments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert function expects n arguments — assert_function_expects_n_arguments","text":"x function check exactly N arguments n number arguments must expected function pass assertion (integer) dots deal '...' dots (.k.variable arguments). count 0, 1 infinite arguments. , just throw error see '...' (default) msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_function_expects_n_arguments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert function expects n arguments — assert_function_expects_n_arguments","text":"invisible(TRUE) function x expects exactly n arguments, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_greater_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is greater than some minimum value — assert_greater_than","title":"Assert input is greater than some minimum value — assert_greater_than","text":"Assert number greater specified minimum value. check numbers vector / matrix minimum value, see assert_all_greater_than()","code":""},{"path":"/reference/assert_greater_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is greater than some minimum value — assert_greater_than","text":"","code":"assert_greater_than( x, minimum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_greater_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is greater than some minimum value — assert_greater_than","text":"x object check minimum minimum value compare (number) msg character string containing error message display x greater specified minimum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_greater_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is greater than some minimum value — assert_greater_than","text":"invisible(TRUE) x greater specified minimum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_greater_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is greater than some minimum value — assert_greater_than","text":"","code":"try({ assert_greater_than(3, 2) # Passes assert_greater_than(3, 2) # Passes assert_greater_than(c(2,3,4), 1) # Throws error (Must be a number) assert_greater_than('A', 1) # Throws error (Must be a number) assert_greater_than(2, 3, msg = \"custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(2, 3, 4)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_greater_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"Assert elements numeric vector/matrix equal minimum value. vectorized version see assert_all_greater_than_or_equal_to()","code":""},{"path":"/reference/assert_greater_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"","code":"assert_greater_than_or_equal_to( x, minimum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_greater_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"x object check minimum minimum value compare msg character string containing error message display x greater equal specified minimum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_greater_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"invisible(TRUE) x greater equal specified minimum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_greater_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"","code":"try({ assert_greater_than_or_equal_to(3, 2) # Passes assert_greater_than_or_equal_to(c(3, 4, 5), 2) # Throws error assert_greater_than_or_equal_to(2, 3) # Throws error }) #> Error in eval(expr, envir) : #> 'c(3, 4, 5)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_identical.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input object is identical to a specified value — assert_identical","title":"Assert that the input object is identical to a specified value — assert_identical","text":"Assert input object identical specified value","code":""},{"path":"/reference/assert_identical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input object is identical to a specified value — assert_identical","text":"","code":"assert_identical(x, y, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_identical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input object is identical to a specified value — assert_identical","text":"x object check y value compare msg character string containing error message display x identical specified value call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_identical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input object is identical to a specified value — assert_identical","text":"invisible(TRUE) x identical specified value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_identical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input object is identical to a specified value — assert_identical","text":"","code":"try({ assert_identical(3, 3) # Passes assert_identical(c(3, 3, 3), 3) # Throws error assert_identical(2, 3) # Throws error }) #> Error in eval(expr, envir) : #> c(3, 3, 3) must be identical to 3"},{"path":"/reference/assert_includes.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert object includes required — assert_includes","title":"Assert object includes required — assert_includes","text":"Assert x includes required elements","code":""},{"path":"/reference/assert_includes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert object includes required — assert_includes","text":"","code":"assert_includes( x, required, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_includes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert object includes required — assert_includes","text":"x object required required elements check msg character string describing error message x include required elements call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_includes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert object includes required — assert_includes","text":"invisible(TRUE) x includes required elements, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_includes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert object includes required — assert_includes","text":"","code":"try({ assert_directory(system.file(\"package = assertions\")) assert_directory(\"foo\") # Throws Error }) #> Error in assert_directory(system.file(\"package = assertions\")) : #> could not find function \"assert_directory\""},{"path":"/reference/assert_int.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is an integer — assert_int","title":"Assert input is an integer — assert_int","text":"Assert input integer","code":""},{"path":"/reference/assert_int.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is an integer — assert_int","text":"","code":"assert_int(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_int.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is an integer — assert_int","text":"x object msg character string containing error message display x integer call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_int.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is an integer — assert_int","text":"invisible(TRUE) x integer, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_int.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Assert input is an integer — assert_int","text":"R, integers whole numbers. integers doubles (numbers decimals) considered numeric. function checks x specifically belong integer class.","code":""},{"path":"/reference/assert_int.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is an integer — assert_int","text":"","code":"try({ assert_int(1) # Passes assert_int(1:10) # Passes assert_int(c(1, 2, 3)) # Passes assert_int(\"a\") # Throws default error assert_int(1.5, msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> '1' must be an integer, not a numeric"},{"path":"/reference/assert_length.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length — assert_length","title":"Assert Length — assert_length","text":"Assert object specific length","code":""},{"path":"/reference/assert_length.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length — assert_length","text":"","code":"assert_length( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length — assert_length","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length — assert_length","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_length_greater_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length Greater Than — assert_length_greater_than","title":"Assert Length Greater Than — assert_length_greater_than","text":"Assert object length greater threshold","code":""},{"path":"/reference/assert_length_greater_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length Greater Than — assert_length_greater_than","text":"","code":"assert_length_greater_than( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length_greater_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length Greater Than — assert_length_greater_than","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length_greater_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length Greater Than — assert_length_greater_than","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_length_greater_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","title":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","text":"Assert object length greater equal threshold","code":""},{"path":"/reference/assert_length_greater_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","text":"","code":"assert_length_greater_than_or_equal_to( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length_greater_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length_greater_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_length_less_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length Less Than — assert_length_less_than","title":"Assert Length Less Than — assert_length_less_than","text":"Assert object length less threshold","code":""},{"path":"/reference/assert_length_less_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length Less Than — assert_length_less_than","text":"","code":"assert_length_less_than( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length_less_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length Less Than — assert_length_less_than","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length_less_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length Less Than — assert_length_less_than","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_length_less_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","title":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","text":"Assert object length less equal threshold","code":""},{"path":"/reference/assert_length_less_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","text":"","code":"assert_length_less_than_or_equal_to( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length_less_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length_less_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_less_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is less than some maximum value — assert_less_than","title":"Assert input is less than some maximum value — assert_less_than","text":"Assert number less specified maximum value. check numbers vector / matrix maximum value, see assert_all_less_than()","code":""},{"path":"/reference/assert_less_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is less than some maximum value — assert_less_than","text":"","code":"assert_less_than( x, maximum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_less_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is less than some maximum value — assert_less_than","text":"x object check maximum maximum value compare (number) msg character string containing error message display x less specified maximum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_less_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is less than some maximum value — assert_less_than","text":"invisible(TRUE) x less specified maximum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_less_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is less than some maximum value — assert_less_than","text":"","code":"try({ assert_less_than(1, 2) # Passes assert_less_than(1, 2) # Passes assert_less_than(c(1,2,3), 4) # Throws error (Must be a number) assert_less_than('A', 1) # Throws error (Must be a number) assert_less_than(3, 2, msg = \"custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_less_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"Assert number less equal specified maximum value. vectorized version see assert_all_less_than_or_equal_to()","code":""},{"path":"/reference/assert_less_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"","code":"assert_less_than_or_equal_to( x, maximum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_less_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"x object check maximum maximum value compare msg character string containing error message display x less equal specified maximum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_less_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"invisible(TRUE) x less equal specified maximum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_less_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"","code":"try({ assert_less_than_or_equal_to(1, 2) # Passes assert_less_than_or_equal_to(c(1, 2, 3), 3) # Throws error assert_less_than_or_equal_to(3, 2) # Throws error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a list — assert_list","title":"Assert input is a list — assert_list","text":"Assert input list","code":""},{"path":"/reference/assert_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a list — assert_list","text":"","code":"assert_list( x, include_dataframes = FALSE, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a list — assert_list","text":"x object include_dataframes logical indicating whether data_frames considered vectors. Default FALSE. msg character string containing error message display x list call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a list — assert_list","text":"invisible(TRUE) x list, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a list — assert_list","text":"","code":"try({ # Assert that a variable is a list x <- list(1, 2, 3) assert_list(x) # does nothing # Assert that a variable is not a list x <- \"not a list\" assert_list(x) # stops execution and prints an error message }) #> Error in eval(expr, envir) : #> 'x' must be a list, not a character"},{"path":"/reference/assert_logical.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is logical — assert_logical","title":"Assert input is logical — assert_logical","text":"Assert R object 'logical' (TRUE/FALSE). Works vector matrix objects. assert object specifically logical vector see assert_logical_vector()","code":""},{"path":"/reference/assert_logical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is logical — assert_logical","text":"","code":"assert_logical(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_logical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is logical — assert_logical","text":"x object msg character string containing error message display x logical call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_logical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is logical — assert_logical","text":"invisible(TRUE) x logical, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_logical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is logical — assert_logical","text":"","code":"try({ assert_logical(TRUE) # Passes assert_logical(c(TRUE, FALSE, TRUE)) # Passes assert_logical(c(\"a\", \"b\")) # Throws default error assert_logical(1:3, \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(\"a\", \"b\")' must be logical, not a character"},{"path":"/reference/assert_logical_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is an atomic logical vector — assert_logical_vector","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"Assert input atomic logical vector","code":""},{"path":"/reference/assert_logical_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"","code":"assert_logical_vector( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_logical_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"x object msg character string containing error message display x atomic logical vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_logical_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"invisible(TRUE) x atomic logical vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_logical_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"","code":"try({ assert_logical_vector(c(TRUE, TRUE, TRUE)) # Passes assert_logical_vector(\"a\") # Throws default error assert_logical_vector(c(1, 0, 1), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> '\"a\"' must be a logical vector, not a character"},{"path":"/reference/assert_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a matrix — assert_matrix","title":"Assert input is a matrix — assert_matrix","text":"Assert input matrix","code":""},{"path":"/reference/assert_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a matrix — assert_matrix","text":"","code":"assert_matrix(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a matrix — assert_matrix","text":"x object msg character string containing error message display x matrix call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a matrix — assert_matrix","text":"invisible(TRUE) x matrix, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a matrix — assert_matrix","text":"","code":"try({ assert_matrix(matrix(1:9, 3)) # Passes assert_matrix(matrix(1:9, 3, 3)) # Passes assert_matrix(c(1, 2, 3)) # Throws default error assert_matrix(1:10, \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' must be a matrix, not a numeric"},{"path":"/reference/assert_names_include.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input object includes a specified name — assert_names_include","title":"Assert that the input object includes a specified name — assert_names_include","text":"Assert input object includes specified name","code":""},{"path":"/reference/assert_names_include.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input object includes a specified name — assert_names_include","text":"","code":"assert_names_include( x, names, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_names_include.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input object includes a specified name — assert_names_include","text":"x object check presence specific names names character vector names check x msg character string containing error message display names present x call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_names_include.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input object includes a specified name — assert_names_include","text":"invisible(TRUE) names present x, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_names_include.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input object includes a specified name — assert_names_include","text":"","code":"try({ x <- list(a = 1, b = 2, c = 3) assert_includes_name(x, \"a\") # Passes assert_includes_name(x, c(\"a\", \"b\")) # Passes assert_includes_name(x, c(\"a\", \"b\", \"d\")) # Throws default error message assert_includes_name(x, c(\"a\", \"b\", \"d\"), \"Custom error message\") # Throws custom error message }) #> Error in assert_includes_name(x, \"a\") : #> could not find function \"assert_includes_name\""},{"path":"/reference/assert_no_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input vector has no duplicates — assert_no_duplicates","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"Assert input vector duplicated elements","code":""},{"path":"/reference/assert_no_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"","code":"assert_no_duplicates( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_no_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"x vector. msg character string containing error message display x duplicates. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_no_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"invisible(TRUE) x duplicates, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_no_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"","code":"try({ assert_no_duplicates(c(1, 2, 3)) # Passes assert_no_duplicates(c(1, 2, 2)) # Throws default error assert_no_duplicates(c(1, 2, 3), msg = \"Custom error message\") # Passes assert_no_duplicates(c(1, 2, 2), msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 2)' must have no duplicates! Found 1 duplicated value: 2"},{"path":"/reference/assert_no_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input vector has no missing values — assert_no_missing","title":"Assert that the input vector has no missing values — assert_no_missing","text":"function asserts input vector missing values (NA) aborts error message .","code":""},{"path":"/reference/assert_no_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input vector has no missing values — assert_no_missing","text":"","code":"assert_no_missing(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_no_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input vector has no missing values — assert_no_missing","text":"x vector. msg character string containing error message display x missing values. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_no_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input vector has no missing values — assert_no_missing","text":"invisible(TRUE) x missing values (NA), otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_no_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input vector has no missing values — assert_no_missing","text":"","code":"try({ assert_no_missing(c(1, 2, 3)) # Passes assert_no_missing(c(1, NA, 2)) # Throws default error assert_no_missing(c(1, 2, 3), msg = \"Custom error message\") # Passes assert_no_missing(c(1, NA, 2), msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(1, NA, 2)' must have no missing values! Found 1"},{"path":"/reference/assert_non_empty_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a non empty character string — assert_non_empty_string","title":"Assert input is a non empty character string — assert_non_empty_string","text":"Asserts input string, nonempty (.e. equal ”)","code":""},{"path":"/reference/assert_non_empty_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a non empty character string — assert_non_empty_string","text":"","code":"assert_non_empty_string( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_non_empty_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a non empty character string — assert_non_empty_string","text":"x object msg character string containing error message display x call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_non_empty_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a non empty character string — assert_non_empty_string","text":"invisible(TRUE) x character vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_non_empty_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a non empty character string — assert_non_empty_string","text":"","code":"try({ assert_non_empty_string(\"a\") # Passes assert_non_empty_string(\"\") # Fails }) #> Error in eval(expr, envir) : #> '\"\"' is an empty string!"},{"path":"/reference/assert_non_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input is not NULL — assert_non_null","title":"Assert that the input is not NULL — assert_non_null","text":"function asserts input NULL aborts error message .","code":""},{"path":"/reference/assert_non_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input is not NULL — assert_non_null","text":"","code":"assert_non_null(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_non_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input is not NULL — assert_non_null","text":"x value check. msg character string containing error message display x NULL. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_non_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input is not NULL — assert_non_null","text":"invisible(TRUE) x NULL, otherwise aborts error message specified msg.","code":""},{"path":"/reference/assert_non_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input is not NULL — assert_non_null","text":"","code":"# Passes for non-NULL assert_non_null(1) try({ # Throws default error for NULL assert_non_null(NULL) # Throws custom error message assert_non_null(NULL, msg = \"Custom error message\") }) #> Error in eval(expr, envir) : 'NULL' must not be NULL!"},{"path":"/reference/assert_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input is NULL — assert_null","title":"Assert that the input is NULL — assert_null","text":"function asserts input NULL aborts error message .","code":""},{"path":"/reference/assert_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input is NULL — assert_null","text":"","code":"assert_null(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input is NULL — assert_null","text":"x value check. msg character string containing error message display x NULL. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input is NULL — assert_null","text":"invisible(TRUE) x NULL, otherwise aborts error message specified msg.","code":""},{"path":"/reference/assert_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input is NULL — assert_null","text":"","code":"assert_null(NULL) # Passes try({ assert_null(1) # Throws default error assert_null(1, msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : '1' must be NULL!"},{"path":"/reference/assert_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a number — assert_number","title":"Assert input is a number — assert_number","text":"number length 1 numeric vector. Numbers can either integers doubles.","code":""},{"path":"/reference/assert_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a number — assert_number","text":"","code":"assert_number(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a number — assert_number","text":"x object msg character string containing error message display x number call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a number — assert_number","text":"invisible(TRUE) x number, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a number — assert_number","text":"","code":"assert_number(2) # Passes try({ assert_number(c(2, 3)) # Throws default error assert_number(\"a\") # Throws default error assert_number(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(2, 3)' is not a number! (length is 2, not 1)"},{"path":"/reference/assert_numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is numeric — assert_numeric","title":"Assert input is numeric — assert_numeric","text":"Assert R object numeric Works vector matrix objects. assert object specifically numeric vector see assert_numeric_vector()","code":""},{"path":"/reference/assert_numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is numeric — assert_numeric","text":"","code":"assert_numeric(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is numeric — assert_numeric","text":"x object msg character string containing error message display x numeric call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_numeric.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is numeric — assert_numeric","text":"invisible(TRUE) x numeric, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_numeric.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is numeric — assert_numeric","text":"","code":"try({ assert_numeric(1:3) # Passes assert_numeric(1.5:5.5) # Passes assert_numeric(c(\"a\", \"b\", \"c\")) # Throws default error assert_numeric(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(\"a\", \"b\", \"c\")' must be numeric, not a character"},{"path":"/reference/assert_numeric_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a numeric vector — assert_numeric_vector","title":"Assert input is a numeric vector — assert_numeric_vector","text":"Assert input numeric vector","code":""},{"path":"/reference/assert_numeric_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a numeric vector — assert_numeric_vector","text":"","code":"assert_numeric_vector( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_numeric_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a numeric vector — assert_numeric_vector","text":"x object msg character string containing error message display x numeric vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_numeric_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a numeric vector — assert_numeric_vector","text":"invisible(TRUE) x numeric vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_one_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a scalar value is one of the acceptable values — assert_one_of","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"Assert x one values y.","code":""},{"path":"/reference/assert_one_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"","code":"assert_one_of(x, y, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_one_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"x scalar value check y vector acceptable values x can take msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_one_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"Returns invisible(TRUE) x scalar one values y, otherwise throws error","code":""},{"path":"/reference/assert_one_of.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"","code":"assert_one_of(3, 1:5) # Passes because 3 is in 1:5 assert_one_of(\"A\", c(\"A\", \"B\", \"C\")) # Passes because \"A\" is in the vector try({ assert_one_of(\"D\", c(\"A\", \"B\", \"C\")) # Throws error because \"D\" is not in the vector }) #> Error in eval(expr, envir) : #> ✖ '\"D\"' must be one of A, B, or C, not D."},{"path":"/reference/assert_reactive.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that x is reactive — assert_reactive","title":"Assert that x is reactive — assert_reactive","text":"Assert x reactive","code":""},{"path":"/reference/assert_reactive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that x is reactive — assert_reactive","text":"","code":"assert_reactive(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_reactive.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that x is reactive — assert_reactive","text":"x object msg character string containing error message display x reactive call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_reactive.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that x is reactive — assert_reactive","text":"invisible(TRUE) x reactive, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_reactive.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that x is reactive — assert_reactive","text":"","code":"try({ # Assert that a variable is reactive x <- shiny::reactive(1) assert_reactive(x) # does nothing # Assert that a variable is not a list x <- 1 assert_reactive(x) # stops execution and prints an error message }) #> Error in eval(expr, envir) : #> 'x' must be a reactive, not a numeric"},{"path":"/reference/assert_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a scalar — assert_scalar","title":"Assert input is a scalar — assert_scalar","text":"Assert object scalar, meaning length 1 atomic vector (numeric(1), character(1) logical(1)). Note lists, data.frames matrices never considered scalar objects, even one element.","code":""},{"path":"/reference/assert_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a scalar — assert_scalar","text":"","code":"assert_scalar(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a scalar — assert_scalar","text":"x object msg character string containing error message display x scalar call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a scalar — assert_scalar","text":"invisible(TRUE) x scalar, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a scalar — assert_scalar","text":"","code":"# Pass when value is scalar assert_scalar(5) # Passes assert_scalar(\"single string\") # Passes assert_scalar(TRUE) # Passes # Fail when value is not try({ assert_scalar(c(1, 2, 3)) # Throws default error assert_scalar(matrix(1:4, 2, 2)) # Throws default error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' must be a scalar, not a numeric"},{"path":"/reference/assert_set_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if two sets are identical — assert_set_equal","title":"Check if two sets are identical — assert_set_equal","text":"function checks x y contain exactly elements, ignoring order duplicates.","code":""},{"path":"/reference/assert_set_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if two sets are identical — assert_set_equal","text":"","code":"assert_set_equal(x, y, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_set_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if two sets are identical — assert_set_equal","text":"x vector compare y Another vector compare x msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_set_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if two sets are identical — assert_set_equal","text":"Returns invisible(TRUE) x y contain elements (ignoring order duplicates), otherwise throws error.","code":""},{"path":"/reference/assert_set_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if two sets are identical — assert_set_equal","text":"","code":"# Passes because elements are the same, order doesn't matter assert_set_equal(c(1, 2, 3), c(3, 2, 1)) # Passes because elements are identical assert_set_equal(c(\"A\", \"B\", \"C\"), c(\"C\", \"A\", \"B\")) try({ # Throws error because elements are not identical assert_set_equal(c(1, 2, 3), c(1, 2)) # Throws error because elements differ assert_set_equal(c(\"A\", \"B\"), c(\"A\", \"B\", \"C\")) }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' contains an unexpected value: 3."},{"path":"/reference/assert_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a character string — assert_string","title":"Assert input is a character string — assert_string","text":"Assert input character string","code":""},{"path":"/reference/assert_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a character string — assert_string","text":"","code":"assert_string(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a character string — assert_string","text":"x object msg character string containing error message display x string call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a character string — assert_string","text":"invisible(TRUE) x string, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a character string — assert_string","text":"","code":"try({ assert_string(\"a\") # Passes assert_string(c(\"a\", \"b\", \"c\")) # Throws default error assert_string(1:3) # Throws default error assert_string(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(\"a\", \"b\", \"c\")' is not a string! (length is 3, not 1)"},{"path":"/reference/assert_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector is a subset of another — assert_subset","title":"Check if a vector is a subset of another — assert_subset","text":"function checks x subset y","code":""},{"path":"/reference/assert_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector is a subset of another — assert_subset","text":"","code":"assert_subset(x, y, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector is a subset of another — assert_subset","text":"x vector check y acceptable values x can take msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector is a subset of another — assert_subset","text":"Returns invisible(TRUE) x subset y, otherwise throws error","code":""},{"path":"/reference/assert_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector is a subset of another — assert_subset","text":"","code":"try({ assert_subset(1:3, 1:5) # Passes assert_subset(c(\"A\", \"B\", \"C\"), c(\"A\", \"B\")) # Throws error since \"C\" is not present in first vector }) #> Error in eval(expr, envir) : #> ✖ 'c(\"A\", \"B\", \"C\")' contain an invalid value: C. Valid values include: #> A and B"},{"path":"/reference/assert_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a vector — assert_vector","title":"Assert input is a vector — assert_vector","text":"Assert input vector","code":""},{"path":"/reference/assert_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a vector — assert_vector","text":"","code":"assert_vector(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a vector — assert_vector","text":"x object msg character string containing error message display x vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a vector — assert_vector","text":"invisible(TRUE) x vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_vector.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Assert input is a vector — assert_vector","text":"default, lists considered vectors (.e. include_lists = FALSE) align end-users expect, spite objects technically vectors.","code":""},{"path":"/reference/assert_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a vector — assert_vector","text":"","code":"try({ assert_vector(c(1, 2, 3)) # Passes assert_vector(matrix(1:6, 2, 3)) # Throws default error message assert_vector(1:3) # Passes assert_vector(list(1, 2, 3)) # Throws default error message assert_vector(list(1, 2, 3), include_lists = TRUE) # Passes assert_vector(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error message assert_vector(factor(c(1, 2, 3)), \"Custom error message\") # Throws custom error message }) #> Error in eval(expr, envir) : #> 'matrix(1:6, 2, 3)' must be a vector, not a matrix and array"},{"path":"/reference/assert_whole_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input object is a whole number — assert_whole_number","title":"Assert that the input object is a whole number — assert_whole_number","text":"Check x whole number (decimal)","code":""},{"path":"/reference/assert_whole_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input object is a whole number — assert_whole_number","text":"","code":"assert_whole_number(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_whole_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input object is a whole number — assert_whole_number","text":"x object msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_whole_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input object is a whole number — assert_whole_number","text":"invisible(TRUE) x whole number, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_whole_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input object is a whole number — assert_whole_number","text":"","code":"try({ assert_whole_number(24) # Passes assert_whole_number(2.5) # Throws error }) #> Error in eval(expr, envir) : #> '2.5' is not a whole number"},{"path":"/reference/assertion_names.html","id":null,"dir":"Reference","previous_headings":"","what":"List assertion names — assertion_names","title":"List assertion names — assertion_names","text":"List assertion names","code":""},{"path":"/reference/assertion_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List assertion names — assertion_names","text":"","code":"assertion_names(exclude_create_and_chain = TRUE)"},{"path":"/reference/assertion_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List assertion names — assertion_names","text":"exclude_create_and_chain exclude assert_create assert_create_chain (flag)","code":""},{"path":"/reference/assertion_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List assertion names — assertion_names","text":"unique set assertion names (character)","code":""},{"path":"/reference/assertion_tests.html","id":null,"dir":"Reference","previous_headings":"","what":"Count tests per Assertion — assertion_tests","title":"Count tests per Assertion — assertion_tests","text":"Count number unit-tests per assertion. Note assertion_tests finds tests expect_ assert_ line.","code":""},{"path":"/reference/assertion_tests.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count tests per Assertion — assertion_tests","text":"","code":"assertion_tests()"},{"path":"/reference/assertion_tests.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count tests per Assertion — assertion_tests","text":"two column data.frame describing assertion name number tests (expect_statement)","code":""},{"path":"/reference/check_all_assertions_are_tested_enough.html","id":null,"dir":"Reference","previous_headings":"","what":"Check assertions are tested enough — check_all_assertions_are_tested_enough","title":"Check assertions are tested enough — check_all_assertions_are_tested_enough","text":"Check assertions tested enough","code":""},{"path":"/reference/check_all_assertions_are_tested_enough.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check assertions are tested enough — check_all_assertions_are_tested_enough","text":"","code":"check_all_assertions_are_tested_enough(min_required_tests = 5)"},{"path":"/reference/check_all_assertions_are_tested_enough.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check assertions are tested enough — check_all_assertions_are_tested_enough","text":"min_required_tests min number tests (expect statements) per assertion","code":""},{"path":"/reference/check_all_assertions_are_tested_enough.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check assertions are tested enough — check_all_assertions_are_tested_enough","text":"TRUE assertions sufficiently tested. Otherwise throws error","code":""},{"path":"/reference/common_roxygen_params.html","id":null,"dir":"Reference","previous_headings":"","what":"Common Parameter Descriptions — common_roxygen_params","title":"Common Parameter Descriptions — common_roxygen_params","text":"Common Parameter Descriptions","code":""},{"path":"/reference/common_roxygen_params.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Common Parameter Descriptions — common_roxygen_params","text":"","code":"common_roxygen_params(call, arg_name, msg, ...)"},{"path":"/reference/common_roxygen_params.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Common Parameter Descriptions — common_roxygen_params","text":"call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name). msg error message thrown assertion fails (string) ... Used pass arguments assertion function","code":""},{"path":"/reference/excludes_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object does not contain prohibited elements — excludes_advanced","title":"Check if an object does not contain prohibited elements — excludes_advanced","text":"function checks x include illegal elements. x must type illegal.","code":""},{"path":"/reference/excludes_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object does not contain prohibited elements — excludes_advanced","text":"","code":"excludes_advanced(x, illegal)"},{"path":"/reference/excludes_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object does not contain prohibited elements — excludes_advanced","text":"x object check illegal prohibited elements check ","code":""},{"path":"/reference/excludes_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object does not contain prohibited elements — excludes_advanced","text":"Returns TRUE x type illegal x include illegal elements. Otherwise returns string representing appropriate error message display","code":""},{"path":"/reference/format_as_bullets.html","id":null,"dir":"Reference","previous_headings":"","what":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","title":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","text":"format_as_bullets function used preprocessing character vectors adding names. names used denote bullet points character vector passed cli::cli_abort(). allows easy creation bullet point lists error messages. bullet argument allows user specify desired bullet point symbol. default bullet point symbols : *, >, , x, v, , !.","code":""},{"path":"/reference/format_as_bullets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","text":"","code":"format_as_bullets(x, bullet = c(\"*\", \">\", \" \", \"x\", \"v\", \"i\", \"!\"))"},{"path":"/reference/format_as_bullets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","text":"x list character strings bullet One ”, '>', ' ', 'x', 'v', '', '!' (default: ”) character use bullet point element x.","code":""},{"path":"/reference/format_as_bullets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","text":"character string element x formatted bullet point","code":""},{"path":"/reference/format_inline.html","id":null,"dir":"Reference","previous_headings":"","what":"Preprocess character vectors for cli package functions — format_inline","title":"Preprocess character vectors for cli package functions — format_inline","text":"Preprocess character vectors cli package functions","code":""},{"path":"/reference/format_inline.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Preprocess character vectors for cli package functions — format_inline","text":"","code":"format_inline(x, inline_tag = c(\"strong\", \"emph\", \"code\", \"arg\"))"},{"path":"/reference/format_inline.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Preprocess character vectors for cli package functions — format_inline","text":"x character vector inline_tag character vector inline tag names (e.g. \"strong\", \"emph\", \"code\", \"arg\")","code":""},{"path":"/reference/format_inline.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Preprocess character vectors for cli package functions — format_inline","text":"character vector inline tags applied element","code":""},{"path":"/reference/has_all_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a named object has all specified names — has_all_names","title":"Check if a named object has all specified names — has_all_names","text":"function returns logical value indicating whether object x names specified names.","code":""},{"path":"/reference/has_all_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a named object has all specified names — has_all_names","text":"","code":"has_all_names(x, names)"},{"path":"/reference/has_all_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a named object has all specified names — has_all_names","text":"x named object names character vector names check x.","code":""},{"path":"/reference/has_all_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a named object has all specified names — has_all_names","text":"logical value indicating whether x names specified names","code":""},{"path":"/reference/has_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Check object is some class — has_class","title":"Check object is some class — has_class","text":"function checks whether object specific class","code":""},{"path":"/reference/has_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check object is some class — has_class","text":"","code":"has_class(x, class)"},{"path":"/reference/has_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check object is some class — has_class","text":"x value check. class checks x belongs class. multiple values class supplied, returns whether x belongs (character)","code":""},{"path":"/reference/has_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check object is some class — has_class","text":"logical scalar indicating x belongs class","code":""},{"path":"/reference/has_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check object is some class — has_class","text":"","code":"if(interactive()) { has_class(1, \"numeric\") # TRUE has_class(1, \"character\") # FALSE }"},{"path":"/reference/has_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector has duplicates — has_duplicates","title":"Check if a vector has duplicates — has_duplicates","text":"function returns logical value indicating whether input vector contains duplicated elements.","code":""},{"path":"/reference/has_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector has duplicates — has_duplicates","text":"","code":"has_duplicates(x)"},{"path":"/reference/has_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector has duplicates — has_duplicates","text":"x vector.","code":""},{"path":"/reference/has_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector has duplicates — has_duplicates","text":"logical value indicating whether input vector contains duplicated elements.","code":""},{"path":"/reference/has_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector has duplicates — has_duplicates","text":"","code":"if(interactive()){ has_duplicates(c(1, 2, 3)) # returns FALSE has_duplicates(c(1, 2, 2)) # returns TRUE }"},{"path":"/reference/has_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"Title — has_extension","title":"Title — has_extension","text":"Title","code":""},{"path":"/reference/has_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Title — has_extension","text":"","code":"has_extension(x, extensions, compression = FALSE)"},{"path":"/reference/has_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Title — has_extension","text":"x object test extensions valid extensions (character vector). include '.', e.g. supply extensions = 'txt' extensions = '.txt' compression compression extension ‘.gz’, ‘.bz2’ ‘.xz’ removed first?","code":""},{"path":"/reference/has_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Title — has_extension","text":"TRUE x valid extensions supplied extensions (flag)","code":""},{"path":"/reference/has_missing_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector has missing values — has_missing_values","title":"Check if a vector has missing values — has_missing_values","text":"function returns logical value indicating whether input vector contains missing values (NA).","code":""},{"path":"/reference/has_missing_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector has missing values — has_missing_values","text":"","code":"has_missing_values(x)"},{"path":"/reference/has_missing_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector has missing values — has_missing_values","text":"x vector.","code":""},{"path":"/reference/has_missing_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector has missing values — has_missing_values","text":"logical value indicating whether input vector contains missing values.","code":""},{"path":"/reference/has_missing_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector has missing values — has_missing_values","text":"","code":"if(interactive()){ has_missing_values(c(1, 2, 3)) # returns FALSE has_missing_values(c(1, NA, 2)) # returns TRUE }"},{"path":"/reference/has_no_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector has no duplicates — has_no_duplicates","title":"Check if a vector has no duplicates — has_no_duplicates","text":"function returns logical value indicating whether input vector contains duplicated elements.","code":""},{"path":"/reference/has_no_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector has no duplicates — has_no_duplicates","text":"","code":"has_no_duplicates(x)"},{"path":"/reference/has_no_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector has no duplicates — has_no_duplicates","text":"x vector.","code":""},{"path":"/reference/has_no_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector has no duplicates — has_no_duplicates","text":"logical value indicating whether input vector contains duplicated elements.","code":""},{"path":"/reference/has_no_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector has no duplicates — has_no_duplicates","text":"","code":"if(interactive()){ has_no_duplicates(c(1, 2, 3)) # returns TRUE has_no_duplicates(c(1, 2, 2)) # returns FALSE }"},{"path":"/reference/has_no_missing_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector has no missing values — has_no_missing_values","title":"Check if a vector has no missing values — has_no_missing_values","text":"function returns logical value indicating whether input vector contains missing values (NA).","code":""},{"path":"/reference/has_no_missing_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector has no missing values — has_no_missing_values","text":"","code":"has_no_missing_values(x)"},{"path":"/reference/has_no_missing_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector has no missing values — has_no_missing_values","text":"x vector.","code":""},{"path":"/reference/has_no_missing_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector has no missing values — has_no_missing_values","text":"logical value indicating whether input vector contains missing values.","code":""},{"path":"/reference/has_no_missing_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector has no missing values — has_no_missing_values","text":"","code":"if(interactive()){ has_no_missing_values(c(1, 2, 3)) # returns TRUE has_no_missing_values(c(1, NA, 2)) # returns FALSE }"},{"path":"/reference/includes.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if All Values in Required are in x — includes","title":"Check if All Values in Required are in x — includes","text":"Checks elements required present x.","code":""},{"path":"/reference/includes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if All Values in Required are in x — includes","text":"","code":"includes(x, required)"},{"path":"/reference/includes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if All Values in Required are in x — includes","text":"x vector elements. required vector elements check inclusion x.","code":""},{"path":"/reference/includes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if All Values in Required are in x — includes","text":"logical value indicating whether elements required present x (TRUE) (FALSE).","code":""},{"path":"/reference/includes_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object contains required elements — includes_advanced","title":"Check if an object contains required elements — includes_advanced","text":"function checks x includes required elements. x must type required.","code":""},{"path":"/reference/includes_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object contains required elements — includes_advanced","text":"","code":"includes_advanced(x, required)"},{"path":"/reference/includes_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object contains required elements — includes_advanced","text":"x object check required required elements check ","code":""},{"path":"/reference/includes_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object contains required elements — includes_advanced","text":"Returns TRUE x type required x includes required elements. Otherwise returns string representing appropriate error message display","code":""},{"path":"/reference/is_character_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a character vector — is_character_vector","title":"Check if an object is a character vector — is_character_vector","text":"Check object character vector","code":""},{"path":"/reference/is_character_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a character vector — is_character_vector","text":"","code":"is_character_vector(x)"},{"path":"/reference/is_character_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a character vector — is_character_vector","text":"x object check.","code":""},{"path":"/reference/is_character_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a character vector — is_character_vector","text":"logical value indicating whether x character vector.","code":""},{"path":"/reference/is_character_vector_or_glue.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a character vector — is_character_vector_or_glue","title":"Check if an object is a character vector — is_character_vector_or_glue","text":"Differs is_character_vector() permits glue character vectors pass.","code":""},{"path":"/reference/is_character_vector_or_glue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a character vector — is_character_vector_or_glue","text":"","code":"is_character_vector_or_glue(x)"},{"path":"/reference/is_character_vector_or_glue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a character vector — is_character_vector_or_glue","text":"x object check.","code":""},{"path":"/reference/is_character_vector_or_glue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a character vector — is_character_vector_or_glue","text":"logical value indicating whether x character vector glue vector.","code":""},{"path":"/reference/is_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check equality of two objects — is_equal","title":"Check equality of two objects — is_equal","text":"x equal y. powered .equal() function.","code":""},{"path":"/reference/is_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check equality of two objects — is_equal","text":"","code":"is_equal( x, y, tolerance = sqrt(.Machine$double.eps), check_names = TRUE, check_environment = TRUE, check_tzone = TRUE )"},{"path":"/reference/is_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check equality of two objects — is_equal","text":"x first object compare y second object compare tolerance Differences smaller tolerance reported. default value close 1.5e-8 (numeric >= 0). check_names names(.) target current compare (flag) check_environment environments functions compared? may need set check.environment=FALSE unexpected cases, comparing two nls() fits. (flag) check_tzone \"tzone\" attributes compared. Important comparing POSIXt objects. (flag)","code":""},{"path":"/reference/is_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check equality of two objects — is_equal","text":"TRUE x equal y","code":""},{"path":"/reference/is_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check equality of two objects — is_equal","text":"","code":"if(interactive()){ is_equal(1, 1) #TRUE is_equal(c(1, 2), 1) #FALSE is_equal(c(\"A\", \"B\"), c(\"A\", \"B\")) #TRUE is_equal(\"A\", \"B\") #FALSE }"},{"path":"/reference/is_flag.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a value is a logical flag — is_flag","title":"Check if a value is a logical flag — is_flag","text":"function checks value logical scalar (.e., single logical value).","code":""},{"path":"/reference/is_flag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a value is a logical flag — is_flag","text":"","code":"is_flag(x)"},{"path":"/reference/is_flag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a value is a logical flag — is_flag","text":"x value check.","code":""},{"path":"/reference/is_flag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a value is a logical flag — is_flag","text":"logical scalar indicating whether x logical flag.","code":""},{"path":"/reference/is_flag_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if x is a flag — is_flag_advanced","title":"Check if x is a flag — is_flag_advanced","text":"function designed use assert_create_advanced. must return TRUE assertion pass string representing error message assertion fail.","code":""},{"path":"/reference/is_flag_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if x is a flag — is_flag_advanced","text":"","code":"is_flag_advanced(x)"},{"path":"/reference/is_flag_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if x is a flag — is_flag_advanced","text":"x value checked","code":""},{"path":"/reference/is_flag_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if x is a flag — is_flag_advanced","text":"Returns invisible(TRUE) x logical value length 1. Returns string error message x logical value length 1.","code":""},{"path":"/reference/is_greater_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"function checks numeric vector greater specified minimum value. can also optionally check elements vector must greater minimum value one element sufficient","code":""},{"path":"/reference/is_greater_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"","code":"is_greater_than(x, minimum)"},{"path":"/reference/is_greater_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"x numeric vector check minimum minimum value compare ","code":""},{"path":"/reference/is_greater_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"logical value indicating whether elements numeric vector x greater specified minimum value","code":""},{"path":"/reference/is_greater_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"","code":"if(interactive()){ is_greater_than(c(2,3,4), 1) # TRUE is_greater_than(c(2,3,4), 2) # TRUE is_greater_than(c(2,3,1), 3) # FALSE }"},{"path":"/reference/is_greater_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"function checks numeric vector greater equal specified minimum value. can also optionally check elements vector must greater equal minimum value one element sufficient","code":""},{"path":"/reference/is_greater_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"","code":"is_greater_than_or_equal_to(x, minimum)"},{"path":"/reference/is_greater_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"x numeric vector check minimum minimum value compare ","code":""},{"path":"/reference/is_greater_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"logical value indicating whether elements numeric vector x greater equal specified minimum value","code":""},{"path":"/reference/is_greater_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"","code":"if(interactive()){ is_greater_than_or_equal_to(c(2,3,4), 1) # TRUE is_greater_than_or_equal_to(c(2,3,4), 2) # TRUE is_greater_than_or_equal_to(c(2,3,1), 3) # FALSE }"},{"path":"/reference/is_identical.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if two objects are identical — is_identical","title":"Check if two objects are identical — is_identical","text":"Check two objects identical","code":""},{"path":"/reference/is_identical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if two objects are identical — is_identical","text":"","code":"is_identical(x, y)"},{"path":"/reference/is_identical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if two objects are identical — is_identical","text":"x first object compare y second object compare","code":""},{"path":"/reference/is_identical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if two objects are identical — is_identical","text":"logical value indicating whether objects identical","code":""},{"path":"/reference/is_less_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a numeric vector is less than a specified maximum value — is_less_than","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"function checks numeric vector less specified maximum value. can also optionally check elements vector must less maximum value one element sufficient","code":""},{"path":"/reference/is_less_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"","code":"is_less_than(x, maximum)"},{"path":"/reference/is_less_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"x numeric vector check maximum maximum value compare ","code":""},{"path":"/reference/is_less_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"logical value indicating whether elements numeric vector x less specified maximum value","code":""},{"path":"/reference/is_less_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"","code":"if(interactive()){ is_less_than(c(1,2,3), 4) # TRUE is_less_than(c(1,2,3), 2) # FALSE is_less_than(c(1,2,4), 3) # FALSE }"},{"path":"/reference/is_less_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"function checks numeric vector less equal specified maximum value. can also optionally check elements vector must less equal maximum value one element sufficient","code":""},{"path":"/reference/is_less_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"","code":"is_less_than_or_equal_to(x, maximum)"},{"path":"/reference/is_less_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"x numeric vector check maximum maximum value compare ","code":""},{"path":"/reference/is_less_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"logical value indicating whether elements numeric vector x less equal specified maximum value","code":""},{"path":"/reference/is_less_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"","code":"if(interactive()){ is_less_than_or_equal_to(c(1,2,3), 4) # TRUE is_less_than_or_equal_to(c(1,2,3), 3) # TRUE is_less_than_or_equal_to(c(1,2,4), 3) # FALSE }"},{"path":"/reference/is_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a value is a list — is_list","title":"Check if a value is a list — is_list","text":"function checks value list. default, definition 'list' excludes data.frames spite technically lists. behaviour can changed setting include_dataframes = TRUE","code":""},{"path":"/reference/is_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a value is a list — is_list","text":"","code":"is_list(x, include_dataframes = FALSE)"},{"path":"/reference/is_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a value is a list — is_list","text":"x value check. include_dataframes logical indicating whether data_frames considered vectors. Default FALSE.","code":""},{"path":"/reference/is_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a value is a list — is_list","text":"logical scalar indicating whether x list.","code":""},{"path":"/reference/is_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a value is a list — is_list","text":"","code":"if(interactive()){ is_list(list(1, 2)) # TRUE is_list(c(1, 2, 3)) # FALSE is_list(data.frame()) # FALSE is_list(data.frame(), include_dataframes = TRUE) # TRUE }"},{"path":"/reference/is_logical_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a logical vector — is_logical_vector","title":"Check if an object is a logical vector — is_logical_vector","text":"Check object logical vector","code":""},{"path":"/reference/is_logical_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a logical vector — is_logical_vector","text":"","code":"is_logical_vector(x)"},{"path":"/reference/is_logical_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a logical vector — is_logical_vector","text":"x object check.","code":""},{"path":"/reference/is_logical_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a logical vector — is_logical_vector","text":"logical value indicating whether x logical vector.","code":""},{"path":"/reference/is_non_empty_string_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if x is a nonempty string — is_non_empty_string_advanced","title":"Check if x is a nonempty string — is_non_empty_string_advanced","text":"function designed use assert_create. returns TRUE assertion pass string representing error message assertion fail.","code":""},{"path":"/reference/is_non_empty_string_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if x is a nonempty string — is_non_empty_string_advanced","text":"","code":"is_non_empty_string_advanced(x)"},{"path":"/reference/is_non_empty_string_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if x is a nonempty string — is_non_empty_string_advanced","text":"x value checked","code":""},{"path":"/reference/is_non_empty_string_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if x is a nonempty string — is_non_empty_string_advanced","text":"Returns invisible(TRUE) x character value length 1 least 1 character string. Returns string error message x character value length 1.","code":""},{"path":"/reference/is_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a single number — is_number","title":"Check if an object is a single number — is_number","text":"Check object single number","code":""},{"path":"/reference/is_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a single number — is_number","text":"","code":"is_number(x)"},{"path":"/reference/is_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a single number — is_number","text":"x object check.","code":""},{"path":"/reference/is_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a single number — is_number","text":"logical value indicating whether x single number.","code":""},{"path":"/reference/is_number_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if x is a number — is_number_advanced","title":"Check if x is a number — is_number_advanced","text":"function designed use assert_create_advanced. must return TRUE assertion pass string representing error message assertion fail.","code":""},{"path":"/reference/is_number_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if x is a number — is_number_advanced","text":"","code":"is_number_advanced(x)"},{"path":"/reference/is_number_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if x is a number — is_number_advanced","text":"x value checked","code":""},{"path":"/reference/is_number_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if x is a number — is_number_advanced","text":"Returns invisible(TRUE) x numeric value length 1. Returns string error message x numeric value length 1.","code":""},{"path":"/reference/is_numeric_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a numeric vector — is_numeric_vector","title":"Check if an object is a numeric vector — is_numeric_vector","text":"function checks object numeric vector R.","code":""},{"path":"/reference/is_numeric_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a numeric vector — is_numeric_vector","text":"","code":"is_numeric_vector(x)"},{"path":"/reference/is_numeric_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a numeric vector — is_numeric_vector","text":"x object check.","code":""},{"path":"/reference/is_numeric_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a numeric vector — is_numeric_vector","text":"logical value indicating whether x numeric vector.","code":""},{"path":"/reference/is_numeric_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if an object is a numeric vector — is_numeric_vector","text":"","code":"if(interactive()){ is_numeric_vector(c(1, 2, 3)) # TRUE is_numeric_vector(list(1, 2, 3)) # FALSE is_numeric_vector(1:5) # TRUE is_numeric_vector(\"hello\") # FALSE is_numeric_vector(list(1, 2, \"a\")) # FALSE }"},{"path":"/reference/is_reactive.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a value is reactive — is_reactive","title":"Check if a value is reactive — is_reactive","text":"function checks value reactive","code":""},{"path":"/reference/is_reactive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a value is reactive — is_reactive","text":"","code":"is_reactive(x)"},{"path":"/reference/is_reactive.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a value is reactive — is_reactive","text":"x value check.","code":""},{"path":"/reference/is_reactive.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a value is reactive — is_reactive","text":"logical scalar indicating whether x list.","code":""},{"path":"/reference/is_reactive.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a value is reactive — is_reactive","text":"","code":"if(interactive()){ is_reactive(shiny::reactive(1)) # TRUE is_reactive(1) # FALSE }"},{"path":"/reference/is_same_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Check equality of type — is_same_type","title":"Check equality of type — is_same_type","text":"type x y (according typof)","code":""},{"path":"/reference/is_same_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check equality of type — is_same_type","text":"","code":"is_same_type(x, y)"},{"path":"/reference/is_same_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check equality of type — is_same_type","text":"x first object compare y second object compare","code":""},{"path":"/reference/is_same_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check equality of type — is_same_type","text":"TRUE x y type, otherwise FALSE","code":""},{"path":"/reference/is_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a single string — is_string","title":"Check if an object is a single string — is_string","text":"Check object single string","code":""},{"path":"/reference/is_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a single string — is_string","text":"","code":"is_string(x)"},{"path":"/reference/is_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a single string — is_string","text":"x object check.","code":""},{"path":"/reference/is_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a single string — is_string","text":"logical value indicating whether x single string.","code":""},{"path":"/reference/is_string_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if x is a string — is_string_advanced","title":"Check if x is a string — is_string_advanced","text":"function designed use assert_create. returns TRUE assertion pass string representing error message assertion fail.","code":""},{"path":"/reference/is_string_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if x is a string — is_string_advanced","text":"","code":"is_string_advanced(x)"},{"path":"/reference/is_string_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if x is a string — is_string_advanced","text":"x value checked","code":""},{"path":"/reference/is_string_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if x is a string — is_string_advanced","text":"Returns invisible(TRUE) x character value length 1. Returns string error message x character value length 1.","code":""},{"path":"/reference/is_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if one set is a subset of another — is_subset","title":"Check if one set is a subset of another — is_subset","text":"Determines elements set x also present set y.","code":""},{"path":"/reference/is_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if one set is a subset of another — is_subset","text":"","code":"is_subset(x, y)"},{"path":"/reference/is_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if one set is a subset of another — is_subset","text":"x numeric, character, logical vector. y numeric, character, logical vector.","code":""},{"path":"/reference/is_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if one set is a subset of another — is_subset","text":"logical value indicating whether x subset y.","code":""},{"path":"/reference/is_superset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if one set is a superset of another — is_superset","title":"Check if one set is a superset of another — is_superset","text":"Determines elements set y also present set x.","code":""},{"path":"/reference/is_superset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if one set is a superset of another — is_superset","text":"","code":"is_superset(x, y)"},{"path":"/reference/is_superset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if one set is a superset of another — is_superset","text":"x numeric, character, logical vector. y numeric, character, logical vector.","code":""},{"path":"/reference/is_superset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if one set is a superset of another — is_superset","text":"logical value indicating whether x superset y.","code":""},{"path":"/reference/is_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a vector This function checks if an object is a vector — is_vector","title":"Check if an object is a vector This function checks if an object is a vector — is_vector","text":"Check object vector function checks object vector","code":""},{"path":"/reference/is_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a vector This function checks if an object is a vector — is_vector","text":"","code":"is_vector(x)"},{"path":"/reference/is_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a vector This function checks if an object is a vector — is_vector","text":"x object check","code":""},{"path":"/reference/is_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a vector This function checks if an object is a vector — is_vector","text":"logical indicating whether x vector","code":""},{"path":"/reference/setopts_are_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare Sets for Equality — setopts_are_equal","title":"Compare Sets for Equality — setopts_are_equal","text":"Determine two sets equal.","code":""},{"path":"/reference/setopts_are_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare Sets for Equality — setopts_are_equal","text":"","code":"setopts_are_equal(x, y)"},{"path":"/reference/setopts_are_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare Sets for Equality — setopts_are_equal","text":"x vector elements. y vector elements.","code":""},{"path":"/reference/setopts_are_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare Sets for Equality — setopts_are_equal","text":"logical value indicating whether sets equal (TRUE) (FALSE).","code":""},{"path":"/reference/setopts_common_elements.html","id":null,"dir":"Reference","previous_headings":"","what":"Find Common Elements — setopts_common_elements","title":"Find Common Elements — setopts_common_elements","text":"Find elements present sets.","code":""},{"path":"/reference/setopts_common_elements.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find Common Elements — setopts_common_elements","text":"","code":"setopts_common_elements(x, y)"},{"path":"/reference/setopts_common_elements.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find Common Elements — setopts_common_elements","text":"x vector elements. y vector elements.","code":""},{"path":"/reference/setopts_common_elements.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find Common Elements — setopts_common_elements","text":"vector elements present sets.","code":""},{"path":"/reference/setopts_count_exlusive_to_first.html","id":null,"dir":"Reference","previous_headings":"","what":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","title":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","text":"Counts number elements first set second set.","code":""},{"path":"/reference/setopts_count_exlusive_to_first.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","text":"","code":"setopts_count_exlusive_to_first(x, y)"},{"path":"/reference/setopts_count_exlusive_to_first.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","text":"x vector elements. y vector elements.","code":""},{"path":"/reference/setopts_count_exlusive_to_first.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","text":"scalar representing number elements first set second set.","code":""},{"path":"/reference/setopts_exlusive_to_first.html","id":null,"dir":"Reference","previous_headings":"","what":"Elements Exclusive to First Set — setopts_exlusive_to_first","title":"Elements Exclusive to First Set — setopts_exlusive_to_first","text":"Finds elements first set second set.","code":""},{"path":"/reference/setopts_exlusive_to_first.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Elements Exclusive to First Set — setopts_exlusive_to_first","text":"","code":"setopts_exlusive_to_first(x, y)"},{"path":"/reference/setopts_exlusive_to_first.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Elements Exclusive to First Set — setopts_exlusive_to_first","text":"x vector elements. y vector elements.","code":""},{"path":"/reference/setopts_exlusive_to_first.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Elements Exclusive to First Set — setopts_exlusive_to_first","text":"vector elements first set second set.","code":""},{"path":"/reference/util_count_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Count the number of duplicated values in a vector — util_count_duplicates","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"function returns number duplicated values input vector.","code":""},{"path":"/reference/util_count_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"","code":"util_count_duplicates(x)"},{"path":"/reference/util_count_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"x vector.","code":""},{"path":"/reference/util_count_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"number duplicated values input vector.","code":""},{"path":"/reference/util_count_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"","code":"if(interactive()) { util_count_duplicates(c(1, 2, 2)) # returns 1 util_count_duplicates(c(1, 2, 3)) # returns 0 }"},{"path":"/reference/util_count_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Count the number of missing values in a vector — util_count_missing","title":"Count the number of missing values in a vector — util_count_missing","text":"function returns number missing values (NA) input vector.","code":""},{"path":"/reference/util_count_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count the number of missing values in a vector — util_count_missing","text":"","code":"util_count_missing(x)"},{"path":"/reference/util_count_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count the number of missing values in a vector — util_count_missing","text":"x vector.","code":""},{"path":"/reference/util_count_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count the number of missing values in a vector — util_count_missing","text":"number missing values input vector.","code":""},{"path":"/reference/util_count_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count the number of missing values in a vector — util_count_missing","text":"","code":"if(interactive()){ util_count_missing(c(1, 2, 3)) # returns 0 util_count_missing(c(1, NA, 2)) # returns 1 }"},{"path":"/reference/util_get_duplicated_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the duplicated values in a vector — util_get_duplicated_values","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"function returns vector duplicated values input vector.","code":""},{"path":"/reference/util_get_duplicated_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"","code":"util_get_duplicated_values(x)"},{"path":"/reference/util_get_duplicated_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"x vector.","code":""},{"path":"/reference/util_get_duplicated_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"vector duplicated values input vector.","code":""},{"path":"/reference/util_get_duplicated_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"","code":"if(interactive()) { util_get_duplicated_values(c(1, 2, 2)) # returns 2 util_get_duplicated_values(c(1, 2, 3)) # returns NULL }"},{"path":"/news/index.html","id":"assertions-0109000","dir":"Changelog","previous_headings":"","what":"assertions 0.1.0.9000","title":"assertions 0.1.0.9000","text":"Added NEWS.md file track changes package.","code":""}]
+[{"path":"/LICENSE.html","id":null,"dir":"","previous_headings":"","what":"MIT License","title":"MIT License","text":"Copyright (c) 2023 assertions authors 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":"/articles/create_custom_assertions.html","id":"getting-started","dir":"Articles","previous_headings":"","what":"Getting Started","title":"Create Custom Assertions","text":"custom assertion want use repeatedly code? create assertion functions assert_create() function! Lets start recreating assert_numeric() assertion using assert_create(): create custom assertion function, need supply two arguments assert_create(): func: function take object assert returns TRUE FALSE depending whether assertion pass fail. default_error_msg: character string providing error message case assertion fails. string can include special termss : {arg_name} refer name variable checked {arg_value} refer value variable. {code_to_evaluate} evaluate code within error message. Customise ‘code_to_evaluate’. e.g {class(arg_name)} {.strong bold_text} perform inline formatting. Customise ‘bold_text’","code":"# Load library library(assertions) # Create a function that asserts input is numeric assert_numeric_2 <- assert_create( func = is.numeric, # Returns TRUE/FALSE for assertion PASS/FAIL default_error_msg = \"'{arg_name}' must be of type numeric, not {class(arg_value)}\" ) # Assertion passes if input is numeric assert_numeric_2(123) # But throws the expected error if input is not numeric assert_numeric_2(\"abc\")"},{"path":"/articles/create_custom_assertions.html","id":"advanced-assertions","dir":"Articles","previous_headings":"","what":"Advanced Assertions","title":"Create Custom Assertions","text":"Problem: Sometimes necessary perform several assertions single object, return error messages specific mode failure. cases, can useful chain together series different assertions object. Solution: assert_create_chain() function allows combine multiple assertion functions created assert_create() single assertion. wrapped assertions evaluated order supplied, assertions fail, appropriate error message returned. Example ’s example use assert_create_chain() create assertion function asserts input string individually asserting Input ‘character’ type Input length 1","code":"assert_string <- assert_create_chain( assert_create(is.character, '{arg_name} must be a character, not {class(arg_value)}'), assert_create(function(s){ length(s)==1 }, '{arg_name} must be length 1, not {arg_value}') ) # Assert String assert_string(\"String\") assert_string(3) # Output: Error: '3' must be a character"},{"path":"/articles/create_custom_assertions.html","id":"more-advanced-assertions","dir":"Articles","previous_headings":"","what":"More Advanced Assertions","title":"Create Custom Assertions","text":"Problem: often need error messages vary significantly based input. Solution cases, convenient define error messages function pass func. work? call assert_create, instead defining default_error_msg, can design func return string assertion fail. string become error message. returning different strings upon different failure conditions, can produce diverse error messages easily. Example ’s recreation example , using func supplies strings indicate assertion failure Additional Notes Note error strings can use special terms {arg_name}, access first argument using original name (e.g. {object}, example ). assert_create changes first arguments name. Values arguments can referred string using {name_of_nonfirst_argument}","code":"# Define Function is_a_string <- function(object){ if(!is.character(object)) return(\"{arg_name} must be a character, not {class(arg_value)}\") if(length(object) != 1){ return(\"{arg_name} must be length 1, not {length(object)}\") } return(TRUE) } # Create Assertion assert_is_string <- assert_create( is_a_string ) # Test assertion works assert_is_string(\"String\") assert_is_string(3) # 3 must be a character, not numeric assert_is_string(c(\"A\", \"B\"))"},{"path":"/authors.html","id":null,"dir":"","previous_headings":"","what":"Authors","title":"Authors and Citation","text":"Sam El-Kamand. Author, maintainer, copyright holder.","code":""},{"path":"/authors.html","id":"citation","dir":"","previous_headings":"","what":"Citation","title":"Authors and Citation","text":"El-Kamand S (2024). assertions: Simple Assertions Beautiful Customisable Error Messages. R package version 0.1.0.9000, https://selkamand.github.io/assertions/, https://github.com/selkamand/assertions.","code":"@Manual{, title = {assertions: Simple Assertions for Beautiful and Customisable Error Messages}, author = {Sam El-Kamand}, year = {2024}, note = {R package version 0.1.0.9000, https://selkamand.github.io/assertions/}, url = {https://github.com/selkamand/assertions}, }"},{"path":"/index.html","id":"assertions-","dir":"","previous_headings":"","what":"Simple Assertions for Beautiful and Customisable Error Messages","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Simple assertions sensible defaults customisable error messages.","code":""},{"path":"/index.html","id":"overview","dir":"","previous_headings":"","what":"Overview","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"goals assertions provide Convenient assertion calls (e.g. assert_number()) general assert function asserts possible condition/s throws informative error messages Extremely user friendly error message defaults. Easily customisable error messages, inline code evaluation & styling powered cli package Simple creation custom assertion functions user-specified defaults","code":""},{"path":"/index.html","id":"installation","dir":"","previous_headings":"","what":"Installation","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"","code":"install.packages(\"assertions\")"},{"path":"/index.html","id":"development-version","dir":"","previous_headings":"Installation","what":"Development version","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"get bug fix use feature development version, can install development version assertions GitHub.","code":"# install.packages('remotes') remotes::install_github('selkamand/assertions')"},{"path":"/index.html","id":"quick-start","dir":"","previous_headings":"","what":"Quick Start","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"assertions start assert, means just type levarage autocomplete suggestions look available options","code":"# Load library library(assertions) # Use premade assertions assert_character(c('a', 'b', 'c')) assert_number(2) assert_flag(TRUE) # Assert anything assert(1000 % 2 == 0) # Assert multiple conditions at once (all must be true) assert(1000 % 2 == 0, 6/2 == 3)"},{"path":"/index.html","id":"customizing-error-messages","dir":"","previous_headings":"","what":"Customizing Error Messages","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"advanced customisation, see cli documentation","code":"# Customise any error messages using the `msg` argument assert_number(\"A\", msg = \"Please supply a number!\") # Evaluate code in your error message using '{}' operators foo = \"A\" assert_number(foo, msg = \"'{foo}' is not a number :(. Try again\") # Emphasise cetain words in error using {.strong text_to_emphasise} assert_number(\"A\", msg = \"{.strong Try again}\")"},{"path":"/index.html","id":"create-your-own-assertion-functions","dir":"","previous_headings":"","what":"Create your own assertion functions","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"custom assertion want use repeatedly? Creating assertion functions extremely easy Just use assert_create(), just need supply: function returns TRUE/FALSE assertion PASS/FAIL default error message example? See ?assert_create() details","code":"# Create a function that asserts input is lowercase assert_lowercase <- assert_create( func = function(x) {x == tolower(x)}, default_error_msg = \"'{arg_name}' must be entirely lowercase\" ) #Assertion passes if input is lowercase assert_lowercase(\"all lower case\") #But throws the expected error if uppercase characters are present assert_lowercase(\"NOT all lower case\")"},{"path":"/index.html","id":"vectorised-assertions","dir":"","previous_headings":"","what":"Vectorised assertions","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Assertions may vectorised versions test whether elements vector/matrix meet condition. example: assert_greater_than() expects single number input assert_all_greater_than() works vectors/matrices. Vectorised functions assert_all_ prefix.","code":""},{"path":"/index.html","id":"contributing-to-this-package","dir":"","previous_headings":"","what":"Contributing to this package","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Two options","code":""},{"path":"/index.html","id":"request-an-assertion","dir":"","previous_headings":"Contributing to this package","what":"Request an assertion","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Open github issue request away. ’m happy implement tonne assertions, just let know want","code":""},{"path":"/index.html","id":"creating-assertions-yourself","dir":"","previous_headings":"Contributing to this package","what":"Creating assertions yourself","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Create custom assert_something function call assert_create() assert_create_chain() Create github issue assertion creation code + helper function pass func argument (e.g. is_something())","code":""},{"path":"/index.html","id":"similar-packages","dir":"","previous_headings":"","what":"Similar Packages","title":"Simple Assertions for Beautiful and Customisable Error Messages","text":"Great alternative packages writing assertions include: assertthat checkmate assertive ensurer package features syntax. hopefully one suits needs preferences. ’m big fan checkmate speed, assertive huge library ready-made assertion functions, assertthat error message customization.","code":""},{"path":"/reference/assert.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that conditions are met — assert","title":"Assert that conditions are met — assert","text":"Assert conditions met","code":""},{"path":"/reference/assert.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that conditions are met — assert","text":"","code":"assert(..., msg = NULL, call = rlang::caller_env())"},{"path":"/reference/assert.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that conditions are met — assert","text":"... list conditions check msg character string containing error message display conditions met. string can include placeholder {failed_expressions} insert list failed expressions. string can also include {?s} {?/} insert correct pluralization list failed expressions. call relevant pooling assertions multi-assertion helper functions. See cli_abort details.","code":""},{"path":"/reference/assert.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that conditions are met — assert","text":"invisible(TRUE) conditions met, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that conditions are met — assert","text":"","code":"try({ assert(1 == 1) # Passes assert(2 == 2, 3 == 3) # Passes assert(2 == 1, 3 == 3) # Throws default error assert(2 == 1, 3 == 3, msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : The following assertions failed: #> ✖ `2 == 1`"},{"path":"/reference/assert_all_directories_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert all files are directories — assert_all_directories_exist","title":"Assert all files are directories — assert_all_directories_exist","text":"Assert paths supplied exist directories. assert single directory exists, see assert_directory_exists()","code":""},{"path":"/reference/assert_all_directories_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert all files are directories — assert_all_directories_exist","text":"","code":"assert_all_directories_exist( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_directories_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert all files are directories — assert_all_directories_exist","text":"x Paths directories (character) msg character string containing error message file x exist call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_directories_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert all files are directories — assert_all_directories_exist","text":"invisible(TRUE) x exists directory, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_directories_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert all files are directories — assert_all_directories_exist","text":"","code":"try({ assert_directory(system.file(\"package = assertions\")) # PASSES assert_directory(\"foo\") # Throws Error }) #> Error in assert_directory(system.file(\"package = assertions\")) : #> could not find function \"assert_directory\""},{"path":"/reference/assert_all_files_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that all files exist — assert_all_files_exist","title":"Assert that all files exist — assert_all_files_exist","text":"Assert files vector exist. assert single file exists, see assert_file_exists()","code":""},{"path":"/reference/assert_all_files_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that all files exist — assert_all_files_exist","text":"","code":"assert_all_files_exist( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_files_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that all files exist — assert_all_files_exist","text":"x Paths files (character) msg character string containing error message files x exist call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_files_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that all files exist — assert_all_files_exist","text":"invisible(TRUE) files x exist, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_files_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that all files exist — assert_all_files_exist","text":"","code":"real_file <- system.file(\"DESCRIPTION\", package = \"assertions\") try({ assert_all_files_exist(c(real_file, real_file)) assert_all_files_exist(c(\"foo\", \"bar\")) # Throws Error }) #> Error in eval(expr, envir) : #> Failed to find files: foo and bar"},{"path":"/reference/assert_all_files_have_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert file extensions — assert_all_files_have_extension","title":"Assert file extensions — assert_all_files_have_extension","text":"Assert filepaths supplied one selected extensions. require file actually exist.","code":""},{"path":"/reference/assert_all_files_have_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert file extensions — assert_all_files_have_extension","text":"","code":"assert_all_files_have_extension( x, extensions, compression = FALSE, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_files_have_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert file extensions — assert_all_files_have_extension","text":"x object extensions valid extensions (character vector). include '.', e.g. supply extensions = 'txt' extensions = '.txt' compression compression extension ‘.gz’, ‘.bz2’ ‘.xz’ removed first? msg character string containing error message file x specified extensions call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_files_have_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert file extensions — assert_all_files_have_extension","text":"invisible(TRUE) x specified extensions, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_files_have_extension.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert file extensions — assert_all_files_have_extension","text":"","code":"try({ assert_all_files_have_extension(c(\"foo.txt\", \"bar.txt\"), extensions = \"txt\") # Passes assert_all_files_have_extension(c(\"foo.txt\", \"bar.csv\"), extensions = \"csv\") # Throws Error }) #> Error in eval(expr, envir) : #> 'c(\"foo.txt\", \"bar.csv\")' has an invalid extension (required #> extension/s: csv). The following file has an unexpected extension: [foo.txt]"},{"path":"/reference/assert_all_greater_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is greater than a specified minimum value — assert_all_greater_than","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"Assert elements numeric vector/matrix minimum value.","code":""},{"path":"/reference/assert_all_greater_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"","code":"assert_all_greater_than( x, minimum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_greater_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"x object check minimum minimum value compare (number) msg character string containing error message display x greater specified minimum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_greater_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"invisible(TRUE) x greater specified minimum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_greater_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is greater than a specified minimum value — assert_all_greater_than","text":"","code":"try({ assert_all_greater_than(3, 2) # Passes assert_all_greater_than(c(2,3,4), 1) # Passes assert_all_greater_than(c(2,3,4), 2) # Passes assert_all_greater_than(c(2,3,1), 3) # Throws default error assert_all_greater_than(c(2,3,1), 3, msg = \"custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> c(2, 3, 4) must all be greater than `2`."},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"Assert elements numeric vector/matrix minimum value.","code":""},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"","code":"assert_all_greater_than_or_equal_to( x, minimum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"x object check minimum minimum value compare msg character string containing error message display x greater equal specified minimum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"invisible(TRUE) x greater equal specified minimum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_greater_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is greater than or equal to a specified minimum value — assert_all_greater_than_or_equal_to","text":"","code":"try({ assert_greater_than_or_equal_to(3, 2) # Passes assert_greater_than_or_equal_to(c(3, 4, 5), 2) # Passes assert_greater_than_or_equal_to(2, 3) # Throws error }) #> Error in eval(expr, envir) : #> 'c(3, 4, 5)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_all_less_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is less than a specified maximum value — assert_all_less_than","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"Assert elements numeric vector/matrix maximum value.","code":""},{"path":"/reference/assert_all_less_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"","code":"assert_all_less_than( x, maximum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_less_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"x object check maximum maximum value compare (number) msg character string containing error message display x less specified maximum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_less_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"invisible(TRUE) x less specified maximum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_less_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is less than a specified maximum value — assert_all_less_than","text":"","code":"try({ assert_all_less_than(1, 2) # Passes assert_all_less_than(c(1,2,3), 4) # Passes assert_all_less_than(c(1,2,3), 2) # Throws default error assert_all_less_than(c(1,2,3), 2, msg = \"custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> c(1, 2, 3) must all be less than `2`."},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"Assert elements numeric vector/matrix equal maximum value.","code":""},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"","code":"assert_all_less_than_or_equal_to( x, maximum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"x object check maximum maximum value compare msg character string containing error message display x less equal specified maximum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"invisible(TRUE) x less equal specified maximum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_all_less_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is less than or equal to a specified maximum value — assert_all_less_than_or_equal_to","text":"","code":"try({ assert_less_than_or_equal_to(1, 2) # Passes assert_less_than_or_equal_to(c(1, 2, 3), 3) # Passes assert_less_than_or_equal_to(3, 2) # Throws error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_character.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a character vector — assert_character","title":"Assert input is a character vector — assert_character","text":"Assert R object 'character' type. Works vector matrix objects. assert object specifically character vector see assert_character_vector()","code":""},{"path":"/reference/assert_character.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a character vector — assert_character","text":"","code":"assert_character(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_character.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a character vector — assert_character","text":"x object msg character string containing error message display x character vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_character.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a character vector — assert_character","text":"invisible(TRUE) x character vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_character.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a character vector — assert_character","text":"","code":"try({ assert_character(\"a\") # Passes assert_character(\"a\") # Passes assert_character(c(\"a\", \"b\", \"c\")) # Passes assert_character(matrix(c('A', 'B', 'C', 'D'))) # Passes assert_character(1:3) # Throws default error assert_character(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> '1:3' must be a character, not a integer"},{"path":"/reference/assert_character_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a character vector — assert_character_vector","title":"Assert input is a character vector — assert_character_vector","text":"Assert object character vector. Length 1 character vectors (strings) considered vectors.","code":""},{"path":"/reference/assert_character_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a character vector — assert_character_vector","text":"","code":"assert_character_vector( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_character_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a character vector — assert_character_vector","text":"x object msg character string containing error message display x character vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_character_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a character vector — assert_character_vector","text":"invisible(TRUE) x character vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_character_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a character vector — assert_character_vector","text":"","code":"try({ assert_character_vector(c(\"a\", \"b\", \"c\")) # Passes assert_character_vector(c(\"a\", 1, \"b\")) # Throws default error assert_character_vector(matrix(c('A', 'B', 'C', 'D'))) # Throws error since type = matrix assert_character_vector(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error assert_character_vector(glue::glue('A')) # Throws error }) #> Error in eval(expr, envir) : #> 'matrix(c(\"A\", \"B\", \"C\", \"D\"))' must be a character vector, not a matrix #> and array"},{"path":"/reference/assert_character_vector_or_glue.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"Assert object character vector (glue vector). Length 1 character vectors (strings) considered vectors.","code":""},{"path":"/reference/assert_character_vector_or_glue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"","code":"assert_character_vector_or_glue( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_character_vector_or_glue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"x object msg character string containing error message display x character vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_character_vector_or_glue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"invisible(TRUE) x character vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_character_vector_or_glue.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a character vector / glue vector — assert_character_vector_or_glue","text":"","code":"try({ assert_character_vector_or_glue(c(\"a\", \"b\", \"c\")) # Passes assert_character_vector_or_glue(glue::glue('A')) # Passes assert_character_vector_or_glue(c(\"a\", 1, \"b\")) # Throws default error assert_character_vector_or_glue(matrix(c('A', 'B', 'C', 'D'))) # Throws error since type = matrix assert_character_vector_or_glue(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'matrix(c(\"A\", \"B\", \"C\", \"D\"))' must be a character vector, not a matrix #> and array"},{"path":"/reference/assert_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert object belongs to class — assert_class","title":"Assert object belongs to class — assert_class","text":"function asserts input object belongs class","code":""},{"path":"/reference/assert_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert object belongs to class — assert_class","text":"","code":"assert_class(x, class, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert object belongs to class — assert_class","text":"x input object class checks x belongs class. multiple values class supplied, returns whether x belongs (character) msg character string containing error message display x belong class call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert object belongs to class — assert_class","text":"invisible(TRUE) x belongs class, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert object belongs to class — assert_class","text":"","code":"try({ assert_has_class(1, \"numeric\") # Passes assert_has_class(1, \"character\") # Throws default error }) #> Error in assert_has_class(1, \"numeric\") : #> could not find function \"assert_has_class\""},{"path":"/reference/assert_connection.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a database connection — assert_connection","title":"Assert input is a database connection — assert_connection","text":"Assert input object database connection, specifically \"DBIConnection\" class, standard virtual class used DBI package database connections. Note assertion test database connection valid /active.","code":""},{"path":"/reference/assert_connection.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a database connection — assert_connection","text":"","code":"assert_connection(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_connection.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a database connection — assert_connection","text":"x object assert database connection msg custom error message displayed x valid database connection. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_connection.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a database connection — assert_connection","text":"invisible(TRUE) x valid database connection, otherwise aborts error message.","code":""},{"path":"/reference/assert_connection.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Assert input is a database connection — assert_connection","text":"function designed use objects inheriting \"DBIConnection\" class, used widely across database connection implementations R. database interface packages introduced, additional checks may added support connection classes.","code":""},{"path":"/reference/assert_connection.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a database connection — assert_connection","text":"","code":"try({ # Assuming a valid DBI connection `conn`: assert_connection(conn) # Passes if `conn` is a DBI connection assert_connection(42) # Fails with error message }) #> Error in eval(match.call()[[2]], envir = call) : object 'conn' not found"},{"path":"/reference/assert_create.html","id":null,"dir":"Reference","previous_headings":"","what":"Create an assertion function — assert_create","title":"Create an assertion function — assert_create","text":"function creates assertion function can used check validity input. assertions provided package created using either assert_create() assert_create_chain()","code":""},{"path":"/reference/assert_create.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create an assertion function — assert_create","text":"","code":"assert_create(func, default_error_msg = NULL)"},{"path":"/reference/assert_create.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create an assertion function — assert_create","text":"func function defining assertion criteria. function return logical value (TRUE assertion passed FALSE fails). Alternatively, instead returning FALSE, can return string act error message. latter case, need supply default_error_msg default_error_msg character string providing error message case assertion fails. Must supplied function func returns FALSE assertion fails (opposed string) Can include following special terms {arg_name} refer name variable supplied assertion. {arg_value} refer value variable supplied assertion {code_to_evaluate} evaluate code within error message. Replace code_to_evaluate code {.strong bold_text} perform inline formatting. Replace bold_text text. See cli documentation details","code":""},{"path":"/reference/assert_create.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create an assertion function — assert_create","text":"assertion function.","code":""},{"path":"/reference/assert_create.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create an assertion function — assert_create","text":"","code":"#' # Create an assertion function that checks that a character string is all # lower case assert_character <- assert_create( is.character, \"{arg_name} must be a character vector, not a {class(arg_value)}\" ) # Use the assertion function try({ is_lower(\"hello\") # Returns invisible TRUE is_lower(\"Hello\") # Aborts the function with the error message }) #> Error in is_lower(\"hello\") : could not find function \"is_lower\""},{"path":"/reference/assert_create_chain.html","id":null,"dir":"Reference","previous_headings":"","what":"Create Chains of Assertions — assert_create_chain","title":"Create Chains of Assertions — assert_create_chain","text":"Combine multiple assertion functions created assert_create() single assertion function diverse failure modes error messages.","code":""},{"path":"/reference/assert_create_chain.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Create Chains of Assertions — assert_create_chain","text":"","code":"assert_create_chain(...)"},{"path":"/reference/assert_create_chain.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Create Chains of Assertions — assert_create_chain","text":"... assertion functions created assert_create().","code":""},{"path":"/reference/assert_create_chain.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Create Chains of Assertions — assert_create_chain","text":"single assertion function calls input functions order supplied.","code":""},{"path":"/reference/assert_create_chain.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Create Chains of Assertions — assert_create_chain","text":"","code":"# Create an assertion function that checks for both positive integers and even values assert_string <- assert_create_chain( assert_create(is.character, '{{arg_name}} must be a character'), assert_create(function(x){{ length(x)==1 }}, '{{arg_name}} must be length 1') ) # Use the assertion function to check a valid value assert_string(\"String\") # Use the assertion function to check an invalid value try({ assert_string(3) # Output: Error: '3' must be a character }) #> Error in eval(expr, envir) : {arg_name} must be a character"},{"path":"/reference/assert_dataframe.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a data frame — assert_dataframe","title":"Assert input is a data frame — assert_dataframe","text":"Assert input data frame","code":""},{"path":"/reference/assert_dataframe.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a data frame — assert_dataframe","text":"","code":"assert_dataframe(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_dataframe.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a data frame — assert_dataframe","text":"x object msg character string containing error message display x data frame call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_dataframe.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a data frame — assert_dataframe","text":"invisible(TRUE) x data frame, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_dataframe.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a data frame — assert_dataframe","text":"","code":"try({ assert_dataframe(mtcars) # Passes assert_dataframe(data.frame()) # Passes assert_dataframe(1:10) # Throws default error assert_dataframe(matrix(1:6, 2, 3)) # Throws default error assert_dataframe(c(1, 2, 3)) # Throws default error: \"Error assert_dataframe(list(a = 1, b = 2)) # Throws default error assert_dataframe(factor(c(1, 2, 3))) # Throws default error assert_dataframe(1:10, msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> '1:10' must be a data.frame, not a integer"},{"path":"/reference/assert_directory_does_not_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert a directory does not exist — assert_directory_does_not_exist","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"Assert directory already exist. Useful avoiding overwriting. function exact copy assert_file_does_not_exist() included make assertion code readable.","code":""},{"path":"/reference/assert_directory_does_not_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"","code":"assert_directory_does_not_exist( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_directory_does_not_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"x Path file (string) msg character string containing error message file x already exists call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_directory_does_not_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"invisible(TRUE) directory x already exist, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_directory_does_not_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert a directory does not exist — assert_directory_does_not_exist","text":"","code":"real_dir <- system.file(\"tests\", package = \"assertions\") try({ assert_directory_does_not_exist(\"foo\") # Passes assert_directory_does_not_exist(real_dir) # Throws error assert_directory_does_not_exist(c(\"foo\", \"bar\")) # Throws Error (single file only) }) #> Error in eval(expr, envir) : #> 'c(\"foo\", \"bar\")' is not a string! (length is 2, not 1)"},{"path":"/reference/assert_directory_exists.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert are directory exists — assert_directory_exists","title":"Assert are directory exists — assert_directory_exists","text":"Assert directory exists. assert directories vector exist, see assert_all_directories_exist()","code":""},{"path":"/reference/assert_directory_exists.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert are directory exists — assert_directory_exists","text":"","code":"assert_directory_exists( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_directory_exists.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert are directory exists — assert_directory_exists","text":"x Path directory (string) msg character string containing error message file x exist call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_directory_exists.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert are directory exists — assert_directory_exists","text":"invisible(TRUE) x exists directory, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_directory_exists.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert are directory exists — assert_directory_exists","text":"","code":"try({ assert_directory_exists(system.file(\"package = assertions\")) # PASS assert_all_directories_exist(\"foo\") # Throws Error }) #> Error in eval(expr, envir) : Failed to find directory:"},{"path":"/reference/assert_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input objects are equal — assert_equal","title":"Assert that the input objects are equal — assert_equal","text":"x equal y. powered .equal() function.","code":""},{"path":"/reference/assert_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input objects are equal — assert_equal","text":"","code":"assert_equal( x, y, tolerance = sqrt(.Machine$double.eps), check_names = TRUE, check_environment = TRUE, check_tzone = TRUE, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input objects are equal — assert_equal","text":"x object check y value compare tolerance Differences smaller tolerance reported. default value close 1.5e-8 (numeric >= 0). check_names names(.) target current compare (flag) check_environment environments functions compared? may need set check.environment=FALSE unexpected cases, comparing two nls() fits. (flag) check_tzone \"tzone\" attributes compared. Important comparing POSIXt objects. (flag) msg character string containing error message display x equal y call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input objects are equal — assert_equal","text":"invisible(TRUE) x equal specified value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input objects are equal — assert_equal","text":"","code":"try({ assert_equal(3, 3) # Passes assert_equal(c(3, 3, 3), 3, ) # Fails assert_equal(2, 3) # Throws error }) #> Error in eval(expr, envir) : #> c(3, 3, 3) must be equal to 3"},{"path":"/reference/assert_excludes.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert object does not include any illegal values — assert_excludes","title":"Assert object does not include any illegal values — assert_excludes","text":"Assert x include illegal elements","code":""},{"path":"/reference/assert_excludes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert object does not include any illegal values — assert_excludes","text":"","code":"assert_excludes( x, illegal, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_excludes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert object does not include any illegal values — assert_excludes","text":"x object illegal prohibited elements check msg character string describing error message x includes illegal elements call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_excludes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert object does not include any illegal values — assert_excludes","text":"invisible(TRUE) x includes illegal elements, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_excludes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert object does not include any illegal values — assert_excludes","text":"","code":"try({ assert_directory(system.file(\"package = assertions\")) assert_directory(\"foo\") # Throws Error }) #> Error in assert_directory(system.file(\"package = assertions\")) : #> could not find function \"assert_directory\""},{"path":"/reference/assert_factor_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a factor — assert_factor_vector","title":"Assert input is a factor — assert_factor_vector","text":"Assert R object factor. Note assert_factor function exists since R factors always vector quantities (never scalar / matrices)","code":""},{"path":"/reference/assert_factor_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a factor — assert_factor_vector","text":"","code":"assert_factor_vector( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_factor_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a factor — assert_factor_vector","text":"x object msg character string containing error message display x factor call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_factor_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a factor — assert_factor_vector","text":"invisible(TRUE) x factor, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_factor_vector.html","id":"details","dir":"Reference","previous_headings":"","what":"Details","title":"Assert input is a factor — assert_factor_vector","text":"Technically function name misleading, since .vector(factor(1)) == FALSE since act exactly like vectors end users, think name suitable","code":""},{"path":"/reference/assert_factor_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a factor — assert_factor_vector","text":"","code":"try({ assert_factor_vector(factor(c(\"a\", \"b\", \"c\"))) # Passes assert_factor_vector(c(\"a\", \"b\", \"c\")) # Throws default error assert_factor_vector(factor(c(\"a\", \"b\", \"c\")), \"Custom error message\") # Passes assert_factor_vector(1:3, \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(\"a\", \"b\", \"c\")' must be a factor, not a character"},{"path":"/reference/assert_file_does_not_exist.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert a file does not exist — assert_file_does_not_exist","title":"Assert a file does not exist — assert_file_does_not_exist","text":"Assert file exist. Useful avoiding overwriting.","code":""},{"path":"/reference/assert_file_does_not_exist.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert a file does not exist — assert_file_does_not_exist","text":"","code":"assert_file_does_not_exist( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_file_does_not_exist.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert a file does not exist — assert_file_does_not_exist","text":"x Path file (string) msg character string containing error message file x already exists call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_file_does_not_exist.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert a file does not exist — assert_file_does_not_exist","text":"invisible(TRUE) file x exist, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_file_does_not_exist.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert a file does not exist — assert_file_does_not_exist","text":"","code":"real_file <- system.file(\"DESCRIPTION\", package = \"assertions\") try({ assert_file_does_not_exist(\"foo\") # Passes assert_file_does_not_exist(real_file) # Throws error assert_file_does_not_exist(c(\"foo\", \"bar\")) # Throws Error (single file only) }) #> Error in eval(expr, envir) : #> File (/home/runner/work/_temp/Library/assertions/DESCRIPTION) already #> exists"},{"path":"/reference/assert_file_exists.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert a file exists — assert_file_exists","title":"Assert a file exists — assert_file_exists","text":"Assert file exists. assert files vector exist, see assert_all_files_exist()","code":""},{"path":"/reference/assert_file_exists.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert a file exists — assert_file_exists","text":"","code":"assert_file_exists(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_file_exists.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert a file exists — assert_file_exists","text":"x Path file (string) msg character string containing error message file x exist call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_file_exists.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert a file exists — assert_file_exists","text":"invisible(TRUE) file x exists, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_file_exists.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert a file exists — assert_file_exists","text":"","code":"real_file <- system.file(\"DESCRIPTION\", package = \"assertions\") try({ assert_file_exists(real_file) # PASSES assert_file_exists(\"foo\") # Throws Error assert_file_exists(c(real_file, real_file)) # Throws Error (should use assert_all_files_exist) }) #> Error in eval(expr, envir) : Failed to find file: foo"},{"path":"/reference/assert_file_has_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert file extensions — assert_file_has_extension","title":"Assert file extensions — assert_file_has_extension","text":"Assert filepath includes one selected extensions. require file actually exist.","code":""},{"path":"/reference/assert_file_has_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert file extensions — assert_file_has_extension","text":"","code":"assert_file_has_extension( x, extensions, compression = FALSE, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_file_has_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert file extensions — assert_file_has_extension","text":"x object extensions valid extensions (character vector). include '.', e.g. supply extensions = 'txt' extensions = '.txt' compression compression extension ‘.gz’, ‘.bz2’ ‘.xz’ removed first? msg character string containing error message file x specified extensions call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_file_has_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert file extensions — assert_file_has_extension","text":"invisible(TRUE) x specified extensions, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_file_has_extension.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert file extensions — assert_file_has_extension","text":"","code":"try({ assert_file_has_extension(\"foo.txt\", extensions = \"txt\") # Passes assert_file_has_extension(\"file.txt\", extensions = \"csv\") # Throws Error }) #> Error in eval(expr, envir) : #> '\"file.txt\"' has an invalid extension (required extension/s: csv). The #> following file has an unexpected extension: [file.txt]"},{"path":"/reference/assert_flag.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a scalar logical — assert_flag","title":"Assert input is a scalar logical — assert_flag","text":"Assert input flag (logical length 1: TRUE FALSE)","code":""},{"path":"/reference/assert_flag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a scalar logical — assert_flag","text":"","code":"assert_flag(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_flag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a scalar logical — assert_flag","text":"x object msg character string containing error message display x scalar logical call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_flag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a scalar logical — assert_flag","text":"invisible(TRUE) x scalar logical, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_flag.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a scalar logical — assert_flag","text":"","code":"try({ assert_flag(TRUE) # Passes assert_flag(FALSE) # Passes assert_flag(c(TRUE, FALSE)) # Throws default error assert_flag(1, \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(TRUE, FALSE)' is not a flag! (length is 2, not 1)"},{"path":"/reference/assert_function.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a function — assert_function","title":"Assert input is a function — assert_function","text":"Assert input function","code":""},{"path":"/reference/assert_function.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a function — assert_function","text":"","code":"assert_function(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_function.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a function — assert_function","text":"x object msg character string containing error message display x function call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_function.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a function — assert_function","text":"invisible(TRUE) x function, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_function.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a function — assert_function","text":"","code":"try({ # Assert that a variable is a function x <- function(a, b) { a + b } assert_function(x) # does nothing # Assert that a variable is not a function x <- \"not a function\" assert_function(x) # stops execution and prints an error message }) #> Error in eval(expr, envir) : #> 'x' must be a function, not a character"},{"path":"/reference/assert_function_expects_n_arguments.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert function expects n arguments — assert_function_expects_n_arguments","title":"Assert function expects n arguments — assert_function_expects_n_arguments","text":"Assert function expects n arguments, user control variable arguments (...) counted (default throws error)","code":""},{"path":"/reference/assert_function_expects_n_arguments.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert function expects n arguments — assert_function_expects_n_arguments","text":"","code":"assert_function_expects_n_arguments( x, n, dots = c(\"throw_error\", \"count_as_0\", \"count_as_1\", \"count_as_inf\"), msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_function_expects_n_arguments.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert function expects n arguments — assert_function_expects_n_arguments","text":"x function check exactly N arguments n number arguments must expected function pass assertion (integer) dots deal '...' dots (.k.variable arguments). count 0, 1 infinite arguments. , just throw error see '...' (default) msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_function_expects_n_arguments.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert function expects n arguments — assert_function_expects_n_arguments","text":"invisible(TRUE) function x expects exactly n arguments, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_greater_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is greater than some minimum value — assert_greater_than","title":"Assert input is greater than some minimum value — assert_greater_than","text":"Assert number greater specified minimum value. check numbers vector / matrix minimum value, see assert_all_greater_than()","code":""},{"path":"/reference/assert_greater_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is greater than some minimum value — assert_greater_than","text":"","code":"assert_greater_than( x, minimum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_greater_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is greater than some minimum value — assert_greater_than","text":"x object check minimum minimum value compare (number) msg character string containing error message display x greater specified minimum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_greater_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is greater than some minimum value — assert_greater_than","text":"invisible(TRUE) x greater specified minimum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_greater_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is greater than some minimum value — assert_greater_than","text":"","code":"try({ assert_greater_than(3, 2) # Passes assert_greater_than(3, 2) # Passes assert_greater_than(c(2,3,4), 1) # Throws error (Must be a number) assert_greater_than('A', 1) # Throws error (Must be a number) assert_greater_than(2, 3, msg = \"custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(2, 3, 4)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_greater_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"Assert elements numeric vector/matrix equal minimum value. vectorized version see assert_all_greater_than_or_equal_to()","code":""},{"path":"/reference/assert_greater_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"","code":"assert_greater_than_or_equal_to( x, minimum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_greater_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"x object check minimum minimum value compare msg character string containing error message display x greater equal specified minimum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_greater_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"invisible(TRUE) x greater equal specified minimum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_greater_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is greater than or equal to a specified minimum value — assert_greater_than_or_equal_to","text":"","code":"try({ assert_greater_than_or_equal_to(3, 2) # Passes assert_greater_than_or_equal_to(c(3, 4, 5), 2) # Throws error assert_greater_than_or_equal_to(2, 3) # Throws error }) #> Error in eval(expr, envir) : #> 'c(3, 4, 5)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_identical.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input object is identical to a specified value — assert_identical","title":"Assert that the input object is identical to a specified value — assert_identical","text":"Assert input object identical specified value","code":""},{"path":"/reference/assert_identical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input object is identical to a specified value — assert_identical","text":"","code":"assert_identical(x, y, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_identical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input object is identical to a specified value — assert_identical","text":"x object check y value compare msg character string containing error message display x identical specified value call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_identical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input object is identical to a specified value — assert_identical","text":"invisible(TRUE) x identical specified value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_identical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input object is identical to a specified value — assert_identical","text":"","code":"try({ assert_identical(3, 3) # Passes assert_identical(c(3, 3, 3), 3) # Throws error assert_identical(2, 3) # Throws error }) #> Error in eval(expr, envir) : #> c(3, 3, 3) must be identical to 3"},{"path":"/reference/assert_includes.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert object includes required — assert_includes","title":"Assert object includes required — assert_includes","text":"Assert x includes required elements","code":""},{"path":"/reference/assert_includes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert object includes required — assert_includes","text":"","code":"assert_includes( x, required, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_includes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert object includes required — assert_includes","text":"x object required required elements check msg character string describing error message x include required elements call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_includes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert object includes required — assert_includes","text":"invisible(TRUE) x includes required elements, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_includes.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert object includes required — assert_includes","text":"","code":"try({ assert_directory(system.file(\"package = assertions\")) assert_directory(\"foo\") # Throws Error }) #> Error in assert_directory(system.file(\"package = assertions\")) : #> could not find function \"assert_directory\""},{"path":"/reference/assert_int.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is an integer — assert_int","title":"Assert input is an integer — assert_int","text":"Assert input integer","code":""},{"path":"/reference/assert_int.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is an integer — assert_int","text":"","code":"assert_int(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_int.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is an integer — assert_int","text":"x object msg character string containing error message display x integer call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_int.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is an integer — assert_int","text":"invisible(TRUE) x integer, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_int.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Assert input is an integer — assert_int","text":"R, integers whole numbers. integers doubles (numbers decimals) considered numeric. function checks x specifically belong integer class.","code":""},{"path":"/reference/assert_int.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is an integer — assert_int","text":"","code":"try({ assert_int(1) # Passes assert_int(1:10) # Passes assert_int(c(1, 2, 3)) # Passes assert_int(\"a\") # Throws default error assert_int(1.5, msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> '1' must be an integer, not a numeric"},{"path":"/reference/assert_length.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length — assert_length","title":"Assert Length — assert_length","text":"Assert object specific length","code":""},{"path":"/reference/assert_length.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length — assert_length","text":"","code":"assert_length( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length — assert_length","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length — assert_length","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_length_greater_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length Greater Than — assert_length_greater_than","title":"Assert Length Greater Than — assert_length_greater_than","text":"Assert object length greater threshold","code":""},{"path":"/reference/assert_length_greater_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length Greater Than — assert_length_greater_than","text":"","code":"assert_length_greater_than( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length_greater_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length Greater Than — assert_length_greater_than","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length_greater_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length Greater Than — assert_length_greater_than","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_length_greater_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","title":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","text":"Assert object length greater equal threshold","code":""},{"path":"/reference/assert_length_greater_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","text":"","code":"assert_length_greater_than_or_equal_to( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length_greater_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length_greater_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length Greater Than or Equal To — assert_length_greater_than_or_equal_to","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_length_less_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length Less Than — assert_length_less_than","title":"Assert Length Less Than — assert_length_less_than","text":"Assert object length less threshold","code":""},{"path":"/reference/assert_length_less_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length Less Than — assert_length_less_than","text":"","code":"assert_length_less_than( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length_less_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length Less Than — assert_length_less_than","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length_less_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length Less Than — assert_length_less_than","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_length_less_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","title":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","text":"Assert object length less equal threshold","code":""},{"path":"/reference/assert_length_less_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","text":"","code":"assert_length_less_than_or_equal_to( x, length, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_length_less_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","text":"x object check length length expected length (number) msg custom error message call (logical) whether preserve call error message arg_name (character) name argument tested","code":""},{"path":"/reference/assert_length_less_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert Length Less Than or Equal To — assert_length_less_than_or_equal_to","text":"invisible(TRUE)","code":""},{"path":"/reference/assert_less_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is less than some maximum value — assert_less_than","title":"Assert input is less than some maximum value — assert_less_than","text":"Assert number less specified maximum value. check numbers vector / matrix maximum value, see assert_all_less_than()","code":""},{"path":"/reference/assert_less_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is less than some maximum value — assert_less_than","text":"","code":"assert_less_than( x, maximum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_less_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is less than some maximum value — assert_less_than","text":"x object check maximum maximum value compare (number) msg character string containing error message display x less specified maximum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_less_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is less than some maximum value — assert_less_than","text":"invisible(TRUE) x less specified maximum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_less_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is less than some maximum value — assert_less_than","text":"","code":"try({ assert_less_than(1, 2) # Passes assert_less_than(1, 2) # Passes assert_less_than(c(1,2,3), 4) # Throws error (Must be a number) assert_less_than('A', 1) # Throws error (Must be a number) assert_less_than(3, 2, msg = \"custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_less_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"Assert number less equal specified maximum value. vectorized version see assert_all_less_than_or_equal_to()","code":""},{"path":"/reference/assert_less_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"","code":"assert_less_than_or_equal_to( x, maximum, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_less_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"x object check maximum maximum value compare msg character string containing error message display x less equal specified maximum value (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_less_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"invisible(TRUE) x less equal specified maximum value, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_less_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is less than or equal to a specified maximum value — assert_less_than_or_equal_to","text":"","code":"try({ assert_less_than_or_equal_to(1, 2) # Passes assert_less_than_or_equal_to(c(1, 2, 3), 3) # Throws error assert_less_than_or_equal_to(3, 2) # Throws error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' is not a number! (length is 3, not 1)"},{"path":"/reference/assert_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a list — assert_list","title":"Assert input is a list — assert_list","text":"Assert input list","code":""},{"path":"/reference/assert_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a list — assert_list","text":"","code":"assert_list( x, include_dataframes = FALSE, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a list — assert_list","text":"x object include_dataframes logical indicating whether data_frames considered vectors. Default FALSE. msg character string containing error message display x list call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a list — assert_list","text":"invisible(TRUE) x list, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a list — assert_list","text":"","code":"try({ # Assert that a variable is a list x <- list(1, 2, 3) assert_list(x) # does nothing # Assert that a variable is not a list x <- \"not a list\" assert_list(x) # stops execution and prints an error message }) #> Error in eval(expr, envir) : #> 'x' must be a list, not a character"},{"path":"/reference/assert_logical.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is logical — assert_logical","title":"Assert input is logical — assert_logical","text":"Assert R object 'logical' (TRUE/FALSE). Works vector matrix objects. assert object specifically logical vector see assert_logical_vector()","code":""},{"path":"/reference/assert_logical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is logical — assert_logical","text":"","code":"assert_logical(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_logical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is logical — assert_logical","text":"x object msg character string containing error message display x logical call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_logical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is logical — assert_logical","text":"invisible(TRUE) x logical, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_logical.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is logical — assert_logical","text":"","code":"try({ assert_logical(TRUE) # Passes assert_logical(c(TRUE, FALSE, TRUE)) # Passes assert_logical(c(\"a\", \"b\")) # Throws default error assert_logical(1:3, \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(\"a\", \"b\")' must be logical, not a character"},{"path":"/reference/assert_logical_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is an atomic logical vector — assert_logical_vector","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"Assert input atomic logical vector","code":""},{"path":"/reference/assert_logical_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"","code":"assert_logical_vector( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_logical_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"x object msg character string containing error message display x atomic logical vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_logical_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"invisible(TRUE) x atomic logical vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_logical_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is an atomic logical vector — assert_logical_vector","text":"","code":"try({ assert_logical_vector(c(TRUE, TRUE, TRUE)) # Passes assert_logical_vector(\"a\") # Throws default error assert_logical_vector(c(1, 0, 1), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> '\"a\"' must be a logical vector, not a character"},{"path":"/reference/assert_matrix.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a matrix — assert_matrix","title":"Assert input is a matrix — assert_matrix","text":"Assert input matrix","code":""},{"path":"/reference/assert_matrix.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a matrix — assert_matrix","text":"","code":"assert_matrix(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_matrix.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a matrix — assert_matrix","text":"x object msg character string containing error message display x matrix call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_matrix.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a matrix — assert_matrix","text":"invisible(TRUE) x matrix, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_matrix.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a matrix — assert_matrix","text":"","code":"try({ assert_matrix(matrix(1:9, 3)) # Passes assert_matrix(matrix(1:9, 3, 3)) # Passes assert_matrix(c(1, 2, 3)) # Throws default error assert_matrix(1:10, \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' must be a matrix, not a numeric"},{"path":"/reference/assert_names_include.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input object includes a specified name — assert_names_include","title":"Assert that the input object includes a specified name — assert_names_include","text":"Assert input object includes specified name","code":""},{"path":"/reference/assert_names_include.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input object includes a specified name — assert_names_include","text":"","code":"assert_names_include( x, names, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_names_include.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input object includes a specified name — assert_names_include","text":"x object check presence specific names names character vector names check x msg character string containing error message display names present x call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_names_include.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input object includes a specified name — assert_names_include","text":"invisible(TRUE) names present x, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_names_include.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input object includes a specified name — assert_names_include","text":"","code":"try({ x <- list(a = 1, b = 2, c = 3) assert_includes_name(x, \"a\") # Passes assert_includes_name(x, c(\"a\", \"b\")) # Passes assert_includes_name(x, c(\"a\", \"b\", \"d\")) # Throws default error message assert_includes_name(x, c(\"a\", \"b\", \"d\"), \"Custom error message\") # Throws custom error message }) #> Error in assert_includes_name(x, \"a\") : #> could not find function \"assert_includes_name\""},{"path":"/reference/assert_no_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input vector has no duplicates — assert_no_duplicates","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"Assert input vector duplicated elements","code":""},{"path":"/reference/assert_no_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"","code":"assert_no_duplicates( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_no_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"x vector. msg character string containing error message display x duplicates. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_no_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"invisible(TRUE) x duplicates, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_no_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input vector has no duplicates — assert_no_duplicates","text":"","code":"try({ assert_no_duplicates(c(1, 2, 3)) # Passes assert_no_duplicates(c(1, 2, 2)) # Throws default error assert_no_duplicates(c(1, 2, 3), msg = \"Custom error message\") # Passes assert_no_duplicates(c(1, 2, 2), msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 2)' must have no duplicates! Found 1 duplicated value: 2"},{"path":"/reference/assert_no_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input vector has no missing values — assert_no_missing","title":"Assert that the input vector has no missing values — assert_no_missing","text":"function asserts input vector missing values (NA) aborts error message .","code":""},{"path":"/reference/assert_no_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input vector has no missing values — assert_no_missing","text":"","code":"assert_no_missing(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_no_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input vector has no missing values — assert_no_missing","text":"x vector. msg character string containing error message display x missing values. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_no_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input vector has no missing values — assert_no_missing","text":"invisible(TRUE) x missing values (NA), otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_no_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input vector has no missing values — assert_no_missing","text":"","code":"try({ assert_no_missing(c(1, 2, 3)) # Passes assert_no_missing(c(1, NA, 2)) # Throws default error assert_no_missing(c(1, 2, 3), msg = \"Custom error message\") # Passes assert_no_missing(c(1, NA, 2), msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(1, NA, 2)' must have no missing values! Found 1"},{"path":"/reference/assert_non_empty_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a non empty character string — assert_non_empty_string","title":"Assert input is a non empty character string — assert_non_empty_string","text":"Asserts input string, nonempty (.e. equal ”)","code":""},{"path":"/reference/assert_non_empty_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a non empty character string — assert_non_empty_string","text":"","code":"assert_non_empty_string( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_non_empty_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a non empty character string — assert_non_empty_string","text":"x object msg character string containing error message display x call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_non_empty_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a non empty character string — assert_non_empty_string","text":"invisible(TRUE) x character vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_non_empty_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a non empty character string — assert_non_empty_string","text":"","code":"try({ assert_non_empty_string(\"a\") # Passes assert_non_empty_string(\"\") # Fails }) #> Error in eval(expr, envir) : #> '\"\"' is an empty string!"},{"path":"/reference/assert_non_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input is not NULL — assert_non_null","title":"Assert that the input is not NULL — assert_non_null","text":"function asserts input NULL aborts error message .","code":""},{"path":"/reference/assert_non_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input is not NULL — assert_non_null","text":"","code":"assert_non_null(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_non_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input is not NULL — assert_non_null","text":"x value check. msg character string containing error message display x NULL. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_non_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input is not NULL — assert_non_null","text":"invisible(TRUE) x NULL, otherwise aborts error message specified msg.","code":""},{"path":"/reference/assert_non_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input is not NULL — assert_non_null","text":"","code":"# Passes for non-NULL assert_non_null(1) try({ # Throws default error for NULL assert_non_null(NULL) # Throws custom error message assert_non_null(NULL, msg = \"Custom error message\") }) #> Error in eval(expr, envir) : 'NULL' must not be NULL!"},{"path":"/reference/assert_null.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input is NULL — assert_null","title":"Assert that the input is NULL — assert_null","text":"function asserts input NULL aborts error message .","code":""},{"path":"/reference/assert_null.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input is NULL — assert_null","text":"","code":"assert_null(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_null.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input is NULL — assert_null","text":"x value check. msg character string containing error message display x NULL. call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_null.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input is NULL — assert_null","text":"invisible(TRUE) x NULL, otherwise aborts error message specified msg.","code":""},{"path":"/reference/assert_null.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input is NULL — assert_null","text":"","code":"assert_null(NULL) # Passes try({ assert_null(1) # Throws default error assert_null(1, msg = \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : '1' must be NULL!"},{"path":"/reference/assert_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a number — assert_number","title":"Assert input is a number — assert_number","text":"number length 1 numeric vector. Numbers can either integers doubles.","code":""},{"path":"/reference/assert_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a number — assert_number","text":"","code":"assert_number(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a number — assert_number","text":"x object msg character string containing error message display x number call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a number — assert_number","text":"invisible(TRUE) x number, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a number — assert_number","text":"","code":"assert_number(2) # Passes try({ assert_number(c(2, 3)) # Throws default error assert_number(\"a\") # Throws default error assert_number(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(2, 3)' is not a number! (length is 2, not 1)"},{"path":"/reference/assert_numeric.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is numeric — assert_numeric","title":"Assert input is numeric — assert_numeric","text":"Assert R object numeric Works vector matrix objects. assert object specifically numeric vector see assert_numeric_vector()","code":""},{"path":"/reference/assert_numeric.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is numeric — assert_numeric","text":"","code":"assert_numeric(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_numeric.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is numeric — assert_numeric","text":"x object msg character string containing error message display x numeric call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_numeric.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is numeric — assert_numeric","text":"invisible(TRUE) x numeric, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_numeric.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is numeric — assert_numeric","text":"","code":"try({ assert_numeric(1:3) # Passes assert_numeric(1.5:5.5) # Passes assert_numeric(c(\"a\", \"b\", \"c\")) # Throws default error assert_numeric(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(\"a\", \"b\", \"c\")' must be numeric, not a character"},{"path":"/reference/assert_numeric_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a numeric vector — assert_numeric_vector","title":"Assert input is a numeric vector — assert_numeric_vector","text":"Assert input numeric vector","code":""},{"path":"/reference/assert_numeric_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a numeric vector — assert_numeric_vector","text":"","code":"assert_numeric_vector( x, msg = NULL, call = rlang::caller_env(), arg_name = NULL )"},{"path":"/reference/assert_numeric_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a numeric vector — assert_numeric_vector","text":"x object msg character string containing error message display x numeric vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_numeric_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a numeric vector — assert_numeric_vector","text":"invisible(TRUE) x numeric vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_one_of.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a scalar value is one of the acceptable values — assert_one_of","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"Assert x one values y.","code":""},{"path":"/reference/assert_one_of.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"","code":"assert_one_of(x, y, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_one_of.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"x scalar value check y vector acceptable values x can take msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_one_of.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"Returns invisible(TRUE) x scalar one values y, otherwise throws error","code":""},{"path":"/reference/assert_one_of.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a scalar value is one of the acceptable values — assert_one_of","text":"","code":"assert_one_of(3, 1:5) # Passes because 3 is in 1:5 assert_one_of(\"A\", c(\"A\", \"B\", \"C\")) # Passes because \"A\" is in the vector try({ assert_one_of(\"D\", c(\"A\", \"B\", \"C\")) # Throws error because \"D\" is not in the vector }) #> Error in eval(expr, envir) : #> ✖ '\"D\"' must be one of A, B, or C, not D."},{"path":"/reference/assert_reactive.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that x is reactive — assert_reactive","title":"Assert that x is reactive — assert_reactive","text":"Assert x reactive","code":""},{"path":"/reference/assert_reactive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that x is reactive — assert_reactive","text":"","code":"assert_reactive(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_reactive.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that x is reactive — assert_reactive","text":"x object msg character string containing error message display x reactive call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_reactive.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that x is reactive — assert_reactive","text":"invisible(TRUE) x reactive, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_reactive.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that x is reactive — assert_reactive","text":"","code":"try({ # Assert that a variable is reactive x <- shiny::reactive(1) assert_reactive(x) # does nothing # Assert that a variable is not a list x <- 1 assert_reactive(x) # stops execution and prints an error message }) #> Error in eval(expr, envir) : #> 'x' must be a reactive, not a numeric"},{"path":"/reference/assert_scalar.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a scalar — assert_scalar","title":"Assert input is a scalar — assert_scalar","text":"Assert object scalar, meaning length 1 atomic vector (numeric(1), character(1) logical(1)). Note lists, data.frames matrices never considered scalar objects, even one element.","code":""},{"path":"/reference/assert_scalar.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a scalar — assert_scalar","text":"","code":"assert_scalar(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_scalar.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a scalar — assert_scalar","text":"x object msg character string containing error message display x scalar call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_scalar.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a scalar — assert_scalar","text":"invisible(TRUE) x scalar, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_scalar.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a scalar — assert_scalar","text":"","code":"# Pass when value is scalar assert_scalar(5) # Passes assert_scalar(\"single string\") # Passes assert_scalar(TRUE) # Passes # Fail when value is not try({ assert_scalar(c(1, 2, 3)) # Throws default error assert_scalar(matrix(1:4, 2, 2)) # Throws default error }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' must be a scalar, not a numeric"},{"path":"/reference/assert_set_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if two sets are identical — assert_set_equal","title":"Check if two sets are identical — assert_set_equal","text":"function checks x y contain exactly elements, ignoring order duplicates.","code":""},{"path":"/reference/assert_set_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if two sets are identical — assert_set_equal","text":"","code":"assert_set_equal(x, y, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_set_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if two sets are identical — assert_set_equal","text":"x vector compare y Another vector compare x msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_set_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if two sets are identical — assert_set_equal","text":"Returns invisible(TRUE) x y contain elements (ignoring order duplicates), otherwise throws error.","code":""},{"path":"/reference/assert_set_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if two sets are identical — assert_set_equal","text":"","code":"# Passes because elements are the same, order doesn't matter assert_set_equal(c(1, 2, 3), c(3, 2, 1)) # Passes because elements are identical assert_set_equal(c(\"A\", \"B\", \"C\"), c(\"C\", \"A\", \"B\")) try({ # Throws error because elements are not identical assert_set_equal(c(1, 2, 3), c(1, 2)) # Throws error because elements differ assert_set_equal(c(\"A\", \"B\"), c(\"A\", \"B\", \"C\")) }) #> Error in eval(expr, envir) : #> 'c(1, 2, 3)' contains an unexpected value: 3."},{"path":"/reference/assert_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a character string — assert_string","title":"Assert input is a character string — assert_string","text":"Assert input character string","code":""},{"path":"/reference/assert_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a character string — assert_string","text":"","code":"assert_string(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a character string — assert_string","text":"x object msg character string containing error message display x string call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a character string — assert_string","text":"invisible(TRUE) x string, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_string.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a character string — assert_string","text":"","code":"try({ assert_string(\"a\") # Passes assert_string(c(\"a\", \"b\", \"c\")) # Throws default error assert_string(1:3) # Throws default error assert_string(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error }) #> Error in eval(expr, envir) : #> 'c(\"a\", \"b\", \"c\")' is not a string! (length is 3, not 1)"},{"path":"/reference/assert_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector is a subset of another — assert_subset","title":"Check if a vector is a subset of another — assert_subset","text":"function checks x subset y","code":""},{"path":"/reference/assert_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector is a subset of another — assert_subset","text":"","code":"assert_subset(x, y, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector is a subset of another — assert_subset","text":"x vector check y acceptable values x can take msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector is a subset of another — assert_subset","text":"Returns invisible(TRUE) x subset y, otherwise throws error","code":""},{"path":"/reference/assert_subset.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector is a subset of another — assert_subset","text":"","code":"try({ assert_subset(1:3, 1:5) # Passes assert_subset(c(\"A\", \"B\", \"C\"), c(\"A\", \"B\")) # Throws error since \"C\" is not present in first vector }) #> Error in eval(expr, envir) : #> ✖ 'c(\"A\", \"B\", \"C\")' contain an invalid value: C. Valid values include: #> A and B"},{"path":"/reference/assert_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert input is a vector — assert_vector","title":"Assert input is a vector — assert_vector","text":"Assert input vector","code":""},{"path":"/reference/assert_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert input is a vector — assert_vector","text":"","code":"assert_vector(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert input is a vector — assert_vector","text":"x object msg character string containing error message display x vector call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert input is a vector — assert_vector","text":"invisible(TRUE) x vector, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_vector.html","id":"note","dir":"Reference","previous_headings":"","what":"Note","title":"Assert input is a vector — assert_vector","text":"default, lists considered vectors (.e. include_lists = FALSE) align end-users expect, spite objects technically vectors.","code":""},{"path":"/reference/assert_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert input is a vector — assert_vector","text":"","code":"try({ assert_vector(c(1, 2, 3)) # Passes assert_vector(matrix(1:6, 2, 3)) # Throws default error message assert_vector(1:3) # Passes assert_vector(list(1, 2, 3)) # Throws default error message assert_vector(list(1, 2, 3), include_lists = TRUE) # Passes assert_vector(c(\"a\", 1, \"b\"), \"Custom error message\") # Throws custom error message assert_vector(factor(c(1, 2, 3)), \"Custom error message\") # Throws custom error message }) #> Error in eval(expr, envir) : #> 'matrix(1:6, 2, 3)' must be a vector, not a matrix and array"},{"path":"/reference/assert_whole_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Assert that the input object is a whole number — assert_whole_number","title":"Assert that the input object is a whole number — assert_whole_number","text":"Check x whole number (decimal)","code":""},{"path":"/reference/assert_whole_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Assert that the input object is a whole number — assert_whole_number","text":"","code":"assert_whole_number(x, msg = NULL, call = rlang::caller_env(), arg_name = NULL)"},{"path":"/reference/assert_whole_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Assert that the input object is a whole number — assert_whole_number","text":"x object msg error message thrown assertion fails (string) call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name).","code":""},{"path":"/reference/assert_whole_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Assert that the input object is a whole number — assert_whole_number","text":"invisible(TRUE) x whole number, otherwise aborts error message specified msg","code":""},{"path":"/reference/assert_whole_number.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Assert that the input object is a whole number — assert_whole_number","text":"","code":"try({ assert_whole_number(24) # Passes assert_whole_number(2.5) # Throws error }) #> Error in eval(expr, envir) : #> '2.5' is not a whole number"},{"path":"/reference/assertion_names.html","id":null,"dir":"Reference","previous_headings":"","what":"List assertion names — assertion_names","title":"List assertion names — assertion_names","text":"List assertion names","code":""},{"path":"/reference/assertion_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"List assertion names — assertion_names","text":"","code":"assertion_names(exclude_create_and_chain = TRUE)"},{"path":"/reference/assertion_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"List assertion names — assertion_names","text":"exclude_create_and_chain exclude assert_create assert_create_chain (flag)","code":""},{"path":"/reference/assertion_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"List assertion names — assertion_names","text":"unique set assertion names (character)","code":""},{"path":"/reference/assertion_tests.html","id":null,"dir":"Reference","previous_headings":"","what":"Count tests per Assertion — assertion_tests","title":"Count tests per Assertion — assertion_tests","text":"Count number unit-tests per assertion. Note assertion_tests finds tests expect_ assert_ line.","code":""},{"path":"/reference/assertion_tests.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count tests per Assertion — assertion_tests","text":"","code":"assertion_tests()"},{"path":"/reference/assertion_tests.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count tests per Assertion — assertion_tests","text":"two column data.frame describing assertion name number tests (expect_statement)","code":""},{"path":"/reference/check_all_assertions_are_tested_enough.html","id":null,"dir":"Reference","previous_headings":"","what":"Check assertions are tested enough — check_all_assertions_are_tested_enough","title":"Check assertions are tested enough — check_all_assertions_are_tested_enough","text":"Check assertions tested enough","code":""},{"path":"/reference/check_all_assertions_are_tested_enough.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check assertions are tested enough — check_all_assertions_are_tested_enough","text":"","code":"check_all_assertions_are_tested_enough(min_required_tests = 5)"},{"path":"/reference/check_all_assertions_are_tested_enough.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check assertions are tested enough — check_all_assertions_are_tested_enough","text":"min_required_tests min number tests (expect statements) per assertion","code":""},{"path":"/reference/check_all_assertions_are_tested_enough.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check assertions are tested enough — check_all_assertions_are_tested_enough","text":"TRUE assertions sufficiently tested. Otherwise throws error","code":""},{"path":"/reference/common_roxygen_params.html","id":null,"dir":"Reference","previous_headings":"","what":"Common Parameter Descriptions — common_roxygen_params","title":"Common Parameter Descriptions — common_roxygen_params","text":"Common Parameter Descriptions","code":""},{"path":"/reference/common_roxygen_params.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Common Parameter Descriptions — common_roxygen_params","text":"","code":"common_roxygen_params(call, arg_name, msg, ...)"},{"path":"/reference/common_roxygen_params.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Common Parameter Descriptions — common_roxygen_params","text":"call relevant pooling assertions multi-assertion helper functions. See cli_abort details. arg_name Advanced use . Name argument passed (default: NULL, automatically extract arg_name). msg error message thrown assertion fails (string) ... Used pass arguments assertion function","code":""},{"path":"/reference/excludes_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object does not contain prohibited elements — excludes_advanced","title":"Check if an object does not contain prohibited elements — excludes_advanced","text":"function checks x include illegal elements. x must type illegal. Factors treated character vectors.","code":""},{"path":"/reference/excludes_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object does not contain prohibited elements — excludes_advanced","text":"","code":"excludes_advanced(x, illegal)"},{"path":"/reference/excludes_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object does not contain prohibited elements — excludes_advanced","text":"x object check illegal prohibited elements check ","code":""},{"path":"/reference/excludes_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object does not contain prohibited elements — excludes_advanced","text":"Returns TRUE x type illegal x include illegal elements. Otherwise returns string representing appropriate error message display","code":""},{"path":"/reference/format_as_bullets.html","id":null,"dir":"Reference","previous_headings":"","what":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","title":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","text":"format_as_bullets function used preprocessing character vectors adding names. names used denote bullet points character vector passed cli::cli_abort(). allows easy creation bullet point lists error messages. bullet argument allows user specify desired bullet point symbol. default bullet point symbols : *, >, , x, v, , !.","code":""},{"path":"/reference/format_as_bullets.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","text":"","code":"format_as_bullets(x, bullet = c(\"*\", \">\", \" \", \"x\", \"v\", \"i\", \"!\"))"},{"path":"/reference/format_as_bullets.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","text":"x list character strings bullet One ”, '>', ' ', 'x', 'v', '', '!' (default: ”) character use bullet point element x.","code":""},{"path":"/reference/format_as_bullets.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Preprocess character vectors for cli::cli_abort() — format_as_bullets","text":"character string element x formatted bullet point","code":""},{"path":"/reference/format_inline.html","id":null,"dir":"Reference","previous_headings":"","what":"Preprocess character vectors for cli package functions — format_inline","title":"Preprocess character vectors for cli package functions — format_inline","text":"Preprocess character vectors cli package functions","code":""},{"path":"/reference/format_inline.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Preprocess character vectors for cli package functions — format_inline","text":"","code":"format_inline(x, inline_tag = c(\"strong\", \"emph\", \"code\", \"arg\"))"},{"path":"/reference/format_inline.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Preprocess character vectors for cli package functions — format_inline","text":"x character vector inline_tag character vector inline tag names (e.g. \"strong\", \"emph\", \"code\", \"arg\")","code":""},{"path":"/reference/format_inline.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Preprocess character vectors for cli package functions — format_inline","text":"character vector inline tags applied element","code":""},{"path":"/reference/has_all_names.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a named object has all specified names — has_all_names","title":"Check if a named object has all specified names — has_all_names","text":"function returns logical value indicating whether object x names specified names.","code":""},{"path":"/reference/has_all_names.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a named object has all specified names — has_all_names","text":"","code":"has_all_names(x, names)"},{"path":"/reference/has_all_names.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a named object has all specified names — has_all_names","text":"x named object names character vector names check x.","code":""},{"path":"/reference/has_all_names.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a named object has all specified names — has_all_names","text":"logical value indicating whether x names specified names","code":""},{"path":"/reference/has_class.html","id":null,"dir":"Reference","previous_headings":"","what":"Check object is some class — has_class","title":"Check object is some class — has_class","text":"function checks whether object specific class","code":""},{"path":"/reference/has_class.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check object is some class — has_class","text":"","code":"has_class(x, class)"},{"path":"/reference/has_class.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check object is some class — has_class","text":"x value check. class checks x belongs class. multiple values class supplied, returns whether x belongs (character)","code":""},{"path":"/reference/has_class.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check object is some class — has_class","text":"logical scalar indicating x belongs class","code":""},{"path":"/reference/has_class.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check object is some class — has_class","text":"","code":"if(interactive()) { has_class(1, \"numeric\") # TRUE has_class(1, \"character\") # FALSE }"},{"path":"/reference/has_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector has duplicates — has_duplicates","title":"Check if a vector has duplicates — has_duplicates","text":"function returns logical value indicating whether input vector contains duplicated elements.","code":""},{"path":"/reference/has_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector has duplicates — has_duplicates","text":"","code":"has_duplicates(x)"},{"path":"/reference/has_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector has duplicates — has_duplicates","text":"x vector.","code":""},{"path":"/reference/has_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector has duplicates — has_duplicates","text":"logical value indicating whether input vector contains duplicated elements.","code":""},{"path":"/reference/has_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector has duplicates — has_duplicates","text":"","code":"if(interactive()){ has_duplicates(c(1, 2, 3)) # returns FALSE has_duplicates(c(1, 2, 2)) # returns TRUE }"},{"path":"/reference/has_extension.html","id":null,"dir":"Reference","previous_headings":"","what":"Title — has_extension","title":"Title — has_extension","text":"Title","code":""},{"path":"/reference/has_extension.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Title — has_extension","text":"","code":"has_extension(x, extensions, compression = FALSE)"},{"path":"/reference/has_extension.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Title — has_extension","text":"x object test extensions valid extensions (character vector). include '.', e.g. supply extensions = 'txt' extensions = '.txt' compression compression extension ‘.gz’, ‘.bz2’ ‘.xz’ removed first?","code":""},{"path":"/reference/has_extension.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Title — has_extension","text":"TRUE x valid extensions supplied extensions (flag)","code":""},{"path":"/reference/has_missing_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector has missing values — has_missing_values","title":"Check if a vector has missing values — has_missing_values","text":"function returns logical value indicating whether input vector contains missing values (NA).","code":""},{"path":"/reference/has_missing_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector has missing values — has_missing_values","text":"","code":"has_missing_values(x)"},{"path":"/reference/has_missing_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector has missing values — has_missing_values","text":"x vector.","code":""},{"path":"/reference/has_missing_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector has missing values — has_missing_values","text":"logical value indicating whether input vector contains missing values.","code":""},{"path":"/reference/has_missing_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector has missing values — has_missing_values","text":"","code":"if(interactive()){ has_missing_values(c(1, 2, 3)) # returns FALSE has_missing_values(c(1, NA, 2)) # returns TRUE }"},{"path":"/reference/has_no_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector has no duplicates — has_no_duplicates","title":"Check if a vector has no duplicates — has_no_duplicates","text":"function returns logical value indicating whether input vector contains duplicated elements.","code":""},{"path":"/reference/has_no_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector has no duplicates — has_no_duplicates","text":"","code":"has_no_duplicates(x)"},{"path":"/reference/has_no_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector has no duplicates — has_no_duplicates","text":"x vector.","code":""},{"path":"/reference/has_no_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector has no duplicates — has_no_duplicates","text":"logical value indicating whether input vector contains duplicated elements.","code":""},{"path":"/reference/has_no_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector has no duplicates — has_no_duplicates","text":"","code":"if(interactive()){ has_no_duplicates(c(1, 2, 3)) # returns TRUE has_no_duplicates(c(1, 2, 2)) # returns FALSE }"},{"path":"/reference/has_no_missing_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a vector has no missing values — has_no_missing_values","title":"Check if a vector has no missing values — has_no_missing_values","text":"function returns logical value indicating whether input vector contains missing values (NA).","code":""},{"path":"/reference/has_no_missing_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a vector has no missing values — has_no_missing_values","text":"","code":"has_no_missing_values(x)"},{"path":"/reference/has_no_missing_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a vector has no missing values — has_no_missing_values","text":"x vector.","code":""},{"path":"/reference/has_no_missing_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a vector has no missing values — has_no_missing_values","text":"logical value indicating whether input vector contains missing values.","code":""},{"path":"/reference/has_no_missing_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a vector has no missing values — has_no_missing_values","text":"","code":"if(interactive()){ has_no_missing_values(c(1, 2, 3)) # returns TRUE has_no_missing_values(c(1, NA, 2)) # returns FALSE }"},{"path":"/reference/includes.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if All Values in Required are in x — includes","title":"Check if All Values in Required are in x — includes","text":"Checks elements required present x.","code":""},{"path":"/reference/includes.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if All Values in Required are in x — includes","text":"","code":"includes(x, required)"},{"path":"/reference/includes.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if All Values in Required are in x — includes","text":"x vector elements. required vector elements check inclusion x.","code":""},{"path":"/reference/includes.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if All Values in Required are in x — includes","text":"logical value indicating whether elements required present x (TRUE) (FALSE).","code":""},{"path":"/reference/includes_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object contains required elements — includes_advanced","title":"Check if an object contains required elements — includes_advanced","text":"function checks x includes required elements. x must type required. Factors treated character vectors.","code":""},{"path":"/reference/includes_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object contains required elements — includes_advanced","text":"","code":"includes_advanced(x, required)"},{"path":"/reference/includes_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object contains required elements — includes_advanced","text":"x object check required required elements check ","code":""},{"path":"/reference/includes_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object contains required elements — includes_advanced","text":"Returns TRUE x type required x includes required elements. Otherwise returns string representing appropriate error message display","code":""},{"path":"/reference/is_character_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a character vector — is_character_vector","title":"Check if an object is a character vector — is_character_vector","text":"Check object character vector","code":""},{"path":"/reference/is_character_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a character vector — is_character_vector","text":"","code":"is_character_vector(x)"},{"path":"/reference/is_character_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a character vector — is_character_vector","text":"x object check.","code":""},{"path":"/reference/is_character_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a character vector — is_character_vector","text":"logical value indicating whether x character vector.","code":""},{"path":"/reference/is_character_vector_or_glue.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a character vector — is_character_vector_or_glue","title":"Check if an object is a character vector — is_character_vector_or_glue","text":"Differs is_character_vector() permits glue character vectors pass.","code":""},{"path":"/reference/is_character_vector_or_glue.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a character vector — is_character_vector_or_glue","text":"","code":"is_character_vector_or_glue(x)"},{"path":"/reference/is_character_vector_or_glue.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a character vector — is_character_vector_or_glue","text":"x object check.","code":""},{"path":"/reference/is_character_vector_or_glue.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a character vector — is_character_vector_or_glue","text":"logical value indicating whether x character vector glue vector.","code":""},{"path":"/reference/is_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Check equality of two objects — is_equal","title":"Check equality of two objects — is_equal","text":"x equal y. powered .equal() function.","code":""},{"path":"/reference/is_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check equality of two objects — is_equal","text":"","code":"is_equal( x, y, tolerance = sqrt(.Machine$double.eps), check_names = TRUE, check_environment = TRUE, check_tzone = TRUE )"},{"path":"/reference/is_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check equality of two objects — is_equal","text":"x first object compare y second object compare tolerance Differences smaller tolerance reported. default value close 1.5e-8 (numeric >= 0). check_names names(.) target current compare (flag) check_environment environments functions compared? may need set check.environment=FALSE unexpected cases, comparing two nls() fits. (flag) check_tzone \"tzone\" attributes compared. Important comparing POSIXt objects. (flag)","code":""},{"path":"/reference/is_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check equality of two objects — is_equal","text":"TRUE x equal y","code":""},{"path":"/reference/is_equal.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check equality of two objects — is_equal","text":"","code":"if(interactive()){ is_equal(1, 1) #TRUE is_equal(c(1, 2), 1) #FALSE is_equal(c(\"A\", \"B\"), c(\"A\", \"B\")) #TRUE is_equal(\"A\", \"B\") #FALSE }"},{"path":"/reference/is_flag.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a value is a logical flag — is_flag","title":"Check if a value is a logical flag — is_flag","text":"function checks value logical scalar (.e., single logical value).","code":""},{"path":"/reference/is_flag.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a value is a logical flag — is_flag","text":"","code":"is_flag(x)"},{"path":"/reference/is_flag.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a value is a logical flag — is_flag","text":"x value check.","code":""},{"path":"/reference/is_flag.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a value is a logical flag — is_flag","text":"logical scalar indicating whether x logical flag.","code":""},{"path":"/reference/is_flag_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if x is a flag — is_flag_advanced","title":"Check if x is a flag — is_flag_advanced","text":"function designed use assert_create_advanced. must return TRUE assertion pass string representing error message assertion fail.","code":""},{"path":"/reference/is_flag_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if x is a flag — is_flag_advanced","text":"","code":"is_flag_advanced(x)"},{"path":"/reference/is_flag_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if x is a flag — is_flag_advanced","text":"x value checked","code":""},{"path":"/reference/is_flag_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if x is a flag — is_flag_advanced","text":"Returns invisible(TRUE) x logical value length 1. Returns string error message x logical value length 1.","code":""},{"path":"/reference/is_greater_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"function checks numeric vector greater specified minimum value. can also optionally check elements vector must greater minimum value one element sufficient","code":""},{"path":"/reference/is_greater_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"","code":"is_greater_than(x, minimum)"},{"path":"/reference/is_greater_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"x numeric vector check minimum minimum value compare ","code":""},{"path":"/reference/is_greater_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"logical value indicating whether elements numeric vector x greater specified minimum value","code":""},{"path":"/reference/is_greater_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a numeric vector is greater than a specified minimum value — is_greater_than","text":"","code":"if(interactive()){ is_greater_than(c(2,3,4), 1) # TRUE is_greater_than(c(2,3,4), 2) # TRUE is_greater_than(c(2,3,1), 3) # FALSE }"},{"path":"/reference/is_greater_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"function checks numeric vector greater equal specified minimum value. can also optionally check elements vector must greater equal minimum value one element sufficient","code":""},{"path":"/reference/is_greater_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"","code":"is_greater_than_or_equal_to(x, minimum)"},{"path":"/reference/is_greater_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"x numeric vector check minimum minimum value compare ","code":""},{"path":"/reference/is_greater_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"logical value indicating whether elements numeric vector x greater equal specified minimum value","code":""},{"path":"/reference/is_greater_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a numeric vector is greater than or equal to a specified minimum value — is_greater_than_or_equal_to","text":"","code":"if(interactive()){ is_greater_than_or_equal_to(c(2,3,4), 1) # TRUE is_greater_than_or_equal_to(c(2,3,4), 2) # TRUE is_greater_than_or_equal_to(c(2,3,1), 3) # FALSE }"},{"path":"/reference/is_identical.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if two objects are identical — is_identical","title":"Check if two objects are identical — is_identical","text":"Check two objects identical","code":""},{"path":"/reference/is_identical.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if two objects are identical — is_identical","text":"","code":"is_identical(x, y)"},{"path":"/reference/is_identical.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if two objects are identical — is_identical","text":"x first object compare y second object compare","code":""},{"path":"/reference/is_identical.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if two objects are identical — is_identical","text":"logical value indicating whether objects identical","code":""},{"path":"/reference/is_less_than.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a numeric vector is less than a specified maximum value — is_less_than","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"function checks numeric vector less specified maximum value. can also optionally check elements vector must less maximum value one element sufficient","code":""},{"path":"/reference/is_less_than.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"","code":"is_less_than(x, maximum)"},{"path":"/reference/is_less_than.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"x numeric vector check maximum maximum value compare ","code":""},{"path":"/reference/is_less_than.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"logical value indicating whether elements numeric vector x less specified maximum value","code":""},{"path":"/reference/is_less_than.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a numeric vector is less than a specified maximum value — is_less_than","text":"","code":"if(interactive()){ is_less_than(c(1,2,3), 4) # TRUE is_less_than(c(1,2,3), 2) # FALSE is_less_than(c(1,2,4), 3) # FALSE }"},{"path":"/reference/is_less_than_or_equal_to.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"function checks numeric vector less equal specified maximum value. can also optionally check elements vector must less equal maximum value one element sufficient","code":""},{"path":"/reference/is_less_than_or_equal_to.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"","code":"is_less_than_or_equal_to(x, maximum)"},{"path":"/reference/is_less_than_or_equal_to.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"x numeric vector check maximum maximum value compare ","code":""},{"path":"/reference/is_less_than_or_equal_to.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"logical value indicating whether elements numeric vector x less equal specified maximum value","code":""},{"path":"/reference/is_less_than_or_equal_to.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a numeric vector is less than or equal to a specified maximum value — is_less_than_or_equal_to","text":"","code":"if(interactive()){ is_less_than_or_equal_to(c(1,2,3), 4) # TRUE is_less_than_or_equal_to(c(1,2,3), 3) # TRUE is_less_than_or_equal_to(c(1,2,4), 3) # FALSE }"},{"path":"/reference/is_list.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a value is a list — is_list","title":"Check if a value is a list — is_list","text":"function checks value list. default, definition 'list' excludes data.frames spite technically lists. behaviour can changed setting include_dataframes = TRUE","code":""},{"path":"/reference/is_list.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a value is a list — is_list","text":"","code":"is_list(x, include_dataframes = FALSE)"},{"path":"/reference/is_list.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a value is a list — is_list","text":"x value check. include_dataframes logical indicating whether data_frames considered vectors. Default FALSE.","code":""},{"path":"/reference/is_list.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a value is a list — is_list","text":"logical scalar indicating whether x list.","code":""},{"path":"/reference/is_list.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a value is a list — is_list","text":"","code":"if(interactive()){ is_list(list(1, 2)) # TRUE is_list(c(1, 2, 3)) # FALSE is_list(data.frame()) # FALSE is_list(data.frame(), include_dataframes = TRUE) # TRUE }"},{"path":"/reference/is_logical_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a logical vector — is_logical_vector","title":"Check if an object is a logical vector — is_logical_vector","text":"Check object logical vector","code":""},{"path":"/reference/is_logical_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a logical vector — is_logical_vector","text":"","code":"is_logical_vector(x)"},{"path":"/reference/is_logical_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a logical vector — is_logical_vector","text":"x object check.","code":""},{"path":"/reference/is_logical_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a logical vector — is_logical_vector","text":"logical value indicating whether x logical vector.","code":""},{"path":"/reference/is_non_empty_string_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if x is a nonempty string — is_non_empty_string_advanced","title":"Check if x is a nonempty string — is_non_empty_string_advanced","text":"function designed use assert_create. returns TRUE assertion pass string representing error message assertion fail.","code":""},{"path":"/reference/is_non_empty_string_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if x is a nonempty string — is_non_empty_string_advanced","text":"","code":"is_non_empty_string_advanced(x)"},{"path":"/reference/is_non_empty_string_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if x is a nonempty string — is_non_empty_string_advanced","text":"x value checked","code":""},{"path":"/reference/is_non_empty_string_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if x is a nonempty string — is_non_empty_string_advanced","text":"Returns invisible(TRUE) x character value length 1 least 1 character string. Returns string error message x character value length 1.","code":""},{"path":"/reference/is_number.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a single number — is_number","title":"Check if an object is a single number — is_number","text":"Check object single number","code":""},{"path":"/reference/is_number.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a single number — is_number","text":"","code":"is_number(x)"},{"path":"/reference/is_number.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a single number — is_number","text":"x object check.","code":""},{"path":"/reference/is_number.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a single number — is_number","text":"logical value indicating whether x single number.","code":""},{"path":"/reference/is_number_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if x is a number — is_number_advanced","title":"Check if x is a number — is_number_advanced","text":"function designed use assert_create_advanced. must return TRUE assertion pass string representing error message assertion fail.","code":""},{"path":"/reference/is_number_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if x is a number — is_number_advanced","text":"","code":"is_number_advanced(x)"},{"path":"/reference/is_number_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if x is a number — is_number_advanced","text":"x value checked","code":""},{"path":"/reference/is_number_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if x is a number — is_number_advanced","text":"Returns invisible(TRUE) x numeric value length 1. Returns string error message x numeric value length 1.","code":""},{"path":"/reference/is_numeric_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a numeric vector — is_numeric_vector","title":"Check if an object is a numeric vector — is_numeric_vector","text":"function checks object numeric vector R.","code":""},{"path":"/reference/is_numeric_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a numeric vector — is_numeric_vector","text":"","code":"is_numeric_vector(x)"},{"path":"/reference/is_numeric_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a numeric vector — is_numeric_vector","text":"x object check.","code":""},{"path":"/reference/is_numeric_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a numeric vector — is_numeric_vector","text":"logical value indicating whether x numeric vector.","code":""},{"path":"/reference/is_numeric_vector.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if an object is a numeric vector — is_numeric_vector","text":"","code":"if(interactive()){ is_numeric_vector(c(1, 2, 3)) # TRUE is_numeric_vector(list(1, 2, 3)) # FALSE is_numeric_vector(1:5) # TRUE is_numeric_vector(\"hello\") # FALSE is_numeric_vector(list(1, 2, \"a\")) # FALSE }"},{"path":"/reference/is_reactive.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if a value is reactive — is_reactive","title":"Check if a value is reactive — is_reactive","text":"function checks value reactive","code":""},{"path":"/reference/is_reactive.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if a value is reactive — is_reactive","text":"","code":"is_reactive(x)"},{"path":"/reference/is_reactive.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if a value is reactive — is_reactive","text":"x value check.","code":""},{"path":"/reference/is_reactive.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if a value is reactive — is_reactive","text":"logical scalar indicating whether x list.","code":""},{"path":"/reference/is_reactive.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Check if a value is reactive — is_reactive","text":"","code":"if(interactive()){ is_reactive(shiny::reactive(1)) # TRUE is_reactive(1) # FALSE }"},{"path":"/reference/is_same_type.html","id":null,"dir":"Reference","previous_headings":"","what":"Check equality of type — is_same_type","title":"Check equality of type — is_same_type","text":"type x y (according typof)","code":""},{"path":"/reference/is_same_type.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check equality of type — is_same_type","text":"","code":"is_same_type(x, y)"},{"path":"/reference/is_same_type.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check equality of type — is_same_type","text":"x first object compare y second object compare","code":""},{"path":"/reference/is_same_type.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check equality of type — is_same_type","text":"TRUE x y type, otherwise FALSE","code":""},{"path":"/reference/is_string.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a single string — is_string","title":"Check if an object is a single string — is_string","text":"Check object single string","code":""},{"path":"/reference/is_string.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a single string — is_string","text":"","code":"is_string(x)"},{"path":"/reference/is_string.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a single string — is_string","text":"x object check.","code":""},{"path":"/reference/is_string.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a single string — is_string","text":"logical value indicating whether x single string.","code":""},{"path":"/reference/is_string_advanced.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if x is a string — is_string_advanced","title":"Check if x is a string — is_string_advanced","text":"function designed use assert_create. returns TRUE assertion pass string representing error message assertion fail.","code":""},{"path":"/reference/is_string_advanced.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if x is a string — is_string_advanced","text":"","code":"is_string_advanced(x)"},{"path":"/reference/is_string_advanced.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if x is a string — is_string_advanced","text":"x value checked","code":""},{"path":"/reference/is_string_advanced.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if x is a string — is_string_advanced","text":"Returns invisible(TRUE) x character value length 1. Returns string error message x character value length 1.","code":""},{"path":"/reference/is_subset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if one set is a subset of another — is_subset","title":"Check if one set is a subset of another — is_subset","text":"Determines elements set x also present set y.","code":""},{"path":"/reference/is_subset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if one set is a subset of another — is_subset","text":"","code":"is_subset(x, y)"},{"path":"/reference/is_subset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if one set is a subset of another — is_subset","text":"x numeric, character, logical vector. y numeric, character, logical vector.","code":""},{"path":"/reference/is_subset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if one set is a subset of another — is_subset","text":"logical value indicating whether x subset y.","code":""},{"path":"/reference/is_superset.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if one set is a superset of another — is_superset","title":"Check if one set is a superset of another — is_superset","text":"Determines elements set y also present set x.","code":""},{"path":"/reference/is_superset.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if one set is a superset of another — is_superset","text":"","code":"is_superset(x, y)"},{"path":"/reference/is_superset.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if one set is a superset of another — is_superset","text":"x numeric, character, logical vector. y numeric, character, logical vector.","code":""},{"path":"/reference/is_superset.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if one set is a superset of another — is_superset","text":"logical value indicating whether x superset y.","code":""},{"path":"/reference/is_vector.html","id":null,"dir":"Reference","previous_headings":"","what":"Check if an object is a vector This function checks if an object is a vector — is_vector","title":"Check if an object is a vector This function checks if an object is a vector — is_vector","text":"Check object vector function checks object vector","code":""},{"path":"/reference/is_vector.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Check if an object is a vector This function checks if an object is a vector — is_vector","text":"","code":"is_vector(x)"},{"path":"/reference/is_vector.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Check if an object is a vector This function checks if an object is a vector — is_vector","text":"x object check","code":""},{"path":"/reference/is_vector.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Check if an object is a vector This function checks if an object is a vector — is_vector","text":"logical indicating whether x vector","code":""},{"path":"/reference/setopts_are_equal.html","id":null,"dir":"Reference","previous_headings":"","what":"Compare Sets for Equality — setopts_are_equal","title":"Compare Sets for Equality — setopts_are_equal","text":"Determine two sets equal.","code":""},{"path":"/reference/setopts_are_equal.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Compare Sets for Equality — setopts_are_equal","text":"","code":"setopts_are_equal(x, y)"},{"path":"/reference/setopts_are_equal.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Compare Sets for Equality — setopts_are_equal","text":"x vector elements. y vector elements.","code":""},{"path":"/reference/setopts_are_equal.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Compare Sets for Equality — setopts_are_equal","text":"logical value indicating whether sets equal (TRUE) (FALSE).","code":""},{"path":"/reference/setopts_common_elements.html","id":null,"dir":"Reference","previous_headings":"","what":"Find Common Elements — setopts_common_elements","title":"Find Common Elements — setopts_common_elements","text":"Find elements present sets.","code":""},{"path":"/reference/setopts_common_elements.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Find Common Elements — setopts_common_elements","text":"","code":"setopts_common_elements(x, y)"},{"path":"/reference/setopts_common_elements.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Find Common Elements — setopts_common_elements","text":"x vector elements. y vector elements.","code":""},{"path":"/reference/setopts_common_elements.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Find Common Elements — setopts_common_elements","text":"vector elements present sets.","code":""},{"path":"/reference/setopts_count_exlusive_to_first.html","id":null,"dir":"Reference","previous_headings":"","what":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","title":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","text":"Counts number elements first set second set.","code":""},{"path":"/reference/setopts_count_exlusive_to_first.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","text":"","code":"setopts_count_exlusive_to_first(x, y)"},{"path":"/reference/setopts_count_exlusive_to_first.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","text":"x vector elements. y vector elements.","code":""},{"path":"/reference/setopts_count_exlusive_to_first.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count of Elements Exclusive to First Set — setopts_count_exlusive_to_first","text":"scalar representing number elements first set second set.","code":""},{"path":"/reference/setopts_exlusive_to_first.html","id":null,"dir":"Reference","previous_headings":"","what":"Elements Exclusive to First Set — setopts_exlusive_to_first","title":"Elements Exclusive to First Set — setopts_exlusive_to_first","text":"Finds elements first set second set.","code":""},{"path":"/reference/setopts_exlusive_to_first.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Elements Exclusive to First Set — setopts_exlusive_to_first","text":"","code":"setopts_exlusive_to_first(x, y)"},{"path":"/reference/setopts_exlusive_to_first.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Elements Exclusive to First Set — setopts_exlusive_to_first","text":"x vector elements. y vector elements.","code":""},{"path":"/reference/setopts_exlusive_to_first.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Elements Exclusive to First Set — setopts_exlusive_to_first","text":"vector elements first set second set.","code":""},{"path":"/reference/util_count_duplicates.html","id":null,"dir":"Reference","previous_headings":"","what":"Count the number of duplicated values in a vector — util_count_duplicates","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"function returns number duplicated values input vector.","code":""},{"path":"/reference/util_count_duplicates.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"","code":"util_count_duplicates(x)"},{"path":"/reference/util_count_duplicates.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"x vector.","code":""},{"path":"/reference/util_count_duplicates.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"number duplicated values input vector.","code":""},{"path":"/reference/util_count_duplicates.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count the number of duplicated values in a vector — util_count_duplicates","text":"","code":"if(interactive()) { util_count_duplicates(c(1, 2, 2)) # returns 1 util_count_duplicates(c(1, 2, 3)) # returns 0 }"},{"path":"/reference/util_count_missing.html","id":null,"dir":"Reference","previous_headings":"","what":"Count the number of missing values in a vector — util_count_missing","title":"Count the number of missing values in a vector — util_count_missing","text":"function returns number missing values (NA) input vector.","code":""},{"path":"/reference/util_count_missing.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Count the number of missing values in a vector — util_count_missing","text":"","code":"util_count_missing(x)"},{"path":"/reference/util_count_missing.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Count the number of missing values in a vector — util_count_missing","text":"x vector.","code":""},{"path":"/reference/util_count_missing.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Count the number of missing values in a vector — util_count_missing","text":"number missing values input vector.","code":""},{"path":"/reference/util_count_missing.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Count the number of missing values in a vector — util_count_missing","text":"","code":"if(interactive()){ util_count_missing(c(1, 2, 3)) # returns 0 util_count_missing(c(1, NA, 2)) # returns 1 }"},{"path":"/reference/util_get_duplicated_values.html","id":null,"dir":"Reference","previous_headings":"","what":"Get the duplicated values in a vector — util_get_duplicated_values","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"function returns vector duplicated values input vector.","code":""},{"path":"/reference/util_get_duplicated_values.html","id":"ref-usage","dir":"Reference","previous_headings":"","what":"Usage","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"","code":"util_get_duplicated_values(x)"},{"path":"/reference/util_get_duplicated_values.html","id":"arguments","dir":"Reference","previous_headings":"","what":"Arguments","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"x vector.","code":""},{"path":"/reference/util_get_duplicated_values.html","id":"value","dir":"Reference","previous_headings":"","what":"Value","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"vector duplicated values input vector.","code":""},{"path":"/reference/util_get_duplicated_values.html","id":"ref-examples","dir":"Reference","previous_headings":"","what":"Examples","title":"Get the duplicated values in a vector — util_get_duplicated_values","text":"","code":"if(interactive()) { util_get_duplicated_values(c(1, 2, 2)) # returns 2 util_get_duplicated_values(c(1, 2, 3)) # returns NULL }"},{"path":"/news/index.html","id":"assertions-0109000","dir":"Changelog","previous_headings":"","what":"assertions 0.1.0.9000","title":"assertions 0.1.0.9000","text":"Added NEWS.md file track changes package.","code":""}]