Package: assertr 3.0.1

Tony Fischetti

assertr: Assertive Programming for R Analysis Pipelines

Provides functionality to assert conditions that have to be met so that errors in data used in analysis pipelines can fail quickly. Similar to 'stopifnot()' but more powerful, friendly, and easier for use in pipelines.

Authors:Tony Fischetti [aut, cre]

assertr.pdf |assertr.html
assertr/json (API)

# Install assertr in R:
install.packages('assertr', repos = c('', ''))

Peer review:

Bug tracker:



37 exports 464 stars 7.42 score 17 dependencies 11 dependents 1.6k downloads

Last updated 2 months agofrom:e484665dba582582faa343d97a09d4a097db3bb1 (via master)



Assertive R Programming with assertr

Rendered fromassertr.Rmdusingknitr::rmarkdownon Jun 11 2024.

Last update: 2021-01-28
Started: 2015-01-20

Readme and manuals

Help Manual

Help pageTopics
Raises error if predicate is FALSE in any columns selectedassert
Raises error if predicate is FALSE for any row after applying row reduction functionassert_rows
assertr: Assertive programming for R analysis pipeline.assertr-package assertr
Chaining functionschaining_functions chain_end chain_start
Concatenate all columns of each row in data frame into a stringcol_concat
Checks if row contains at least one value duplicated in its columnduplicates_across_cols
Generates random ID stringgenerate_id
Returns TRUE if data.frame or list has specified nameshas_all_names
Returns TRUE if data.frame columns have a specified classhas_class
Returns TRUE if data.frame or list has only the specified nameshas_only_names
Returns TRUE if value in setin_set
Raises error if dynamically created predicate is FALSE in any columns selectedinsist
Raises error if dynamically created predicate is FALSE for any row after applying row reduction functioninsist_rows
Returns TRUE where no elements appear more than onceis_uniq
Computes mahalanobis distance for each row of data framemaha_dist
Returns TRUE if value is not NAnot_na
Counts number of NAs in each rownum_row_NAs
Printing assertr's assert errorsprint.assertr_assert_error
Printing assertr's defectprint.assertr_defect
Printing assertr's successprint.assertr_success
Printing assertr's verify errorsprint.assertr_verify_error
Success and error functionsdefect_append defect_df_return defect_report error_append error_df_return error_logical error_report error_return error_stop just_warn success_and_error_functions success_append success_continue success_df_return success_logical success_report warning_append warn_report
Summarizing assertr's assert errorssummary.assertr_assert_error
Summarizing assertr's verify errorssummary.assertr_verify_error
Raises error if expression is FALSE anywhereverify
Creates bounds checking predicatewithin_bounds
Return a function to create robust z-score checking predicatewithin_n_mads
Return a function to create z-score checking predicatewithin_n_sds