Package: assertions 0.2.0

assertions: Simple Assertions for Beautiful and Customisable Error Messages

Provides simple assertions with sensible defaults and customisable error messages. It offers convenient assertion call wrappers and a general assert function that can handle any condition. Default error messages are user friendly and easily customized with inline code evaluation and styling powered by the 'cli' package.

Authors:Sam El-Kamand [aut, cre, cph]

assertions_0.2.0.tar.gz
assertions_0.2.0.zip(r-4.5)assertions_0.2.0.zip(r-4.4)assertions_0.2.0.zip(r-4.3)
assertions_0.2.0.tgz(r-4.4-any)assertions_0.2.0.tgz(r-4.3-any)
assertions_0.2.0.tar.gz(r-4.5-noble)assertions_0.2.0.tar.gz(r-4.4-noble)
assertions_0.2.0.tgz(r-4.4-emscripten)assertions_0.2.0.tgz(r-4.3-emscripten)
assertions.pdf |assertions.html
assertions/json (API)
NEWS

# Install 'assertions' in R:
install.packages('assertions', repos = c('https://selkamand.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/selkamand/assertions/issues

On CRAN:

6.88 score 2 stars 3 packages 168 scripts 447 downloads 60 exports 3 dependencies

Last updated 2 days agofrom:389b8e1df6. Checks:OK: 7. Indexed: yes.

TargetResultDate
Doc / VignettesOKNov 19 2024
R-4.5-winOKNov 19 2024
R-4.5-linuxOKNov 19 2024
R-4.4-winOKNov 19 2024
R-4.4-macOKNov 19 2024
R-4.3-winOKNov 19 2024
R-4.3-macOKNov 19 2024

Exports:assertassert_all_directories_existassert_all_files_existassert_all_files_have_extensionassert_all_greater_thanassert_all_greater_than_or_equal_toassert_all_less_thanassert_all_less_than_or_equal_toassert_characterassert_character_vectorassert_character_vector_or_glueassert_classassert_connectionassert_createassert_create_chainassert_dataframeassert_directory_does_not_existassert_directory_existsassert_equalassert_excludesassert_factor_vectorassert_file_does_not_existassert_file_existsassert_file_has_extensionassert_flagassert_functionassert_function_expects_n_argumentsassert_greater_thanassert_greater_than_or_equal_toassert_identicalassert_includesassert_intassert_lengthassert_length_greater_thanassert_length_greater_than_or_equal_toassert_length_less_thanassert_length_less_than_or_equal_toassert_less_thanassert_less_than_or_equal_toassert_listassert_logicalassert_logical_vectorassert_matrixassert_names_includeassert_no_duplicatesassert_no_missingassert_non_empty_stringassert_non_nullassert_nullassert_numberassert_numericassert_numeric_vectorassert_one_ofassert_reactiveassert_scalarassert_set_equalassert_stringassert_subsetassert_vectorassert_whole_number

Dependencies:cligluerlang

Create Custom Assertions

Rendered fromcreate_custom_assertions.Rmdusingknitr::rmarkdownon Nov 19 2024.

Last update: 2023-09-27
Started: 2023-01-08

Readme and manuals

Help Manual

Help pageTopics
Assert that conditions are metassert
Assert all files are directoriesassert_all_directories_exist
Assert that all files existassert_all_files_exist
Assert file extensionsassert_all_files_have_extension
Assert input is greater than a specified minimum valueassert_all_greater_than
Assert input is greater than or equal to a specified minimum valueassert_all_greater_than_or_equal_to
Assert input is less than a specified maximum valueassert_all_less_than
Assert input is less than or equal to a specified maximum valueassert_all_less_than_or_equal_to
Assert input is a character vectorassert_character
Assert input is a character vectorassert_character_vector
Assert input is a character vector / glue vectorassert_character_vector_or_glue
Assert object belongs to classassert_class
Assert input is a database connectionassert_connection
Create an assertion functionassert_create
Create Chains of Assertionsassert_create_chain
Assert input is a data frameassert_dataframe
Assert a directory does not existassert_directory_does_not_exist
Assert are directory existsassert_directory_exists
Assert that the input objects are equalassert_equal
Assert object does not include any illegal valuesassert_excludes
Assert input is a factorassert_factor_vector
Assert a file does not existassert_file_does_not_exist
Assert a file existsassert_file_exists
Assert file extensionsassert_file_has_extension
Assert input is a scalar logicalassert_flag
Assert input is a functionassert_function
Assert function expects n argumentsassert_function_expects_n_arguments
Assert input is greater than some minimum valueassert_greater_than
Assert input is greater than or equal to a specified minimum valueassert_greater_than_or_equal_to
Assert that the input object is identical to a specified valueassert_identical
Assert object includes requiredassert_includes
Assert input is an integerassert_int
Assert Lengthassert_length
Assert Length Greater Thanassert_length_greater_than
Assert Length Greater Than or Equal Toassert_length_greater_than_or_equal_to
Assert Length Less Thanassert_length_less_than
Assert Length Less Than or Equal Toassert_length_less_than_or_equal_to
Assert input is less than some maximum valueassert_less_than
Assert input is less than or equal to a specified maximum valueassert_less_than_or_equal_to
Assert input is a listassert_list
Assert input is logicalassert_logical
Assert input is an atomic logical vectorassert_logical_vector
Assert input is a matrixassert_matrix
Assert that the input object includes a specified nameassert_names_include
Assert that the input vector has no duplicatesassert_no_duplicates
Assert that the input vector has no missing valuesassert_no_missing
Assert input is a non empty character stringassert_non_empty_string
Assert that the input is not NULLassert_non_null
Assert that the input is NULLassert_null
Assert input is a numberassert_number
Assert input is numericassert_numeric
Assert input is a numeric vectorassert_numeric_vector
Check if a scalar value is one of the acceptable valuesassert_one_of
Assert that x is reactiveassert_reactive
Assert input is a scalarassert_scalar
Check if two sets are identicalassert_set_equal
Assert input is a character stringassert_string
Check if a vector is a subset of anotherassert_subset
Assert input is a vectorassert_vector
Assert that the input object is a whole numberassert_whole_number
List assertion namesassertion_names
Count tests per Assertionassertion_tests
Check assertions are tested enoughcheck_all_assertions_are_tested_enough
Common Parameter Descriptionscommon_roxygen_params
Check if an object does not contain prohibited elementsexcludes_advanced
Preprocess character vectors for cli::cli_abort()format_as_bullets
Preprocess character vectors for cli package functionsformat_inline
Check if a named object has all specified nameshas_all_names
Check object is some classhas_class
Check if a vector has duplicateshas_duplicates
Has Extensionhas_extension
Check if a vector has missing valueshas_missing_values
Check if a vector has no duplicateshas_no_duplicates
Check if a vector has no missing valueshas_no_missing_values
Check if All Values in Required are in xincludes
Check if an object contains required elementsincludes_advanced
Check if an object is a character vectoris_character_vector
Check if an object is a character vectoris_character_vector_or_glue
Check equality of two objectsis_equal
Check if a value is a logical flagis_flag
Check if x is a flagis_flag_advanced
Check if a numeric vector is greater than a specified minimum valueis_greater_than
Check if a numeric vector is greater than or equal to a specified minimum valueis_greater_than_or_equal_to
Check if two objects are identicalis_identical
Check if a numeric vector is less than a specified maximum valueis_less_than
Check if a numeric vector is less than or equal to a specified maximum valueis_less_than_or_equal_to
Check if a value is a listis_list
Check if an object is a logical vectoris_logical_vector
Check if x is a nonempty stringis_non_empty_string_advanced
Check if an object is a single numberis_number
Check if x is a numberis_number_advanced
Check if an object is a numeric vectoris_numeric_vector
Check if a value is reactiveis_reactive
Check equality of typeis_same_type
Check if an object is a single stringis_string
Check if x is a stringis_string_advanced
Check if one set is a subset of anotheris_subset
Check if one set is a superset of anotheris_superset
Check if an object is a vector This function checks if an object is a vectoris_vector
Compare Sets for Equalitysetopts_are_equal
Find Common Elementssetopts_common_elements
Count of Elements Exclusive to First Setsetopts_count_exlusive_to_first
Elements Exclusive to First Setsetopts_exlusive_to_first
Count the number of duplicated values in a vectorutil_count_duplicates
Count the number of missing values in a vectorutil_count_missing
Get the duplicated values in a vectorutil_get_duplicated_values