- Same as previous version.
-
chk now requires R >= 4.1.
-
check_data()andcheck_values()now require the levels of a factor column to be identical (including order) to the levels ofvalueswhenevervalueshas two or more levels; previously two levels only required an ordered superset (#297). -
check_data()andcheck_values()now require all values of a column to be missing when the correspondingvaluesare all missing.
-
New
chk_all_na()andvld_all_na()check that all values are missing (#299). -
New
chk_class()andvld_class()check that an object inherits from a class usinginherits()regardless of the object system. -
New
chk_s3_class_strict()andvld_s3_class_strict()check that an object is an S3 object of the given class (excluding S4, R5, R6 and S7 objects). -
New
generate_check_data()generates the code for acheck_data()call from an example data frame (#124). -
chk_s3_class()andchk_s4_class()errors now state the class(es) of the object to help diagnose issues. -
chkor_vld()gains anx_nameargument that is passed to each of the underlyingchk_calls, so the error message refers tox_namerather than the deparsedvld_arguments (#100). -
vld_s4_class()is now vectorized overclasslikevld_s3_class(), sochk_s4_class()accepts multiple classes.
-
check_data()now names the offending argument when passed a non-data frame, instead of reporting "data.frame". -
chk_lte()now sets thexandvaluefields on its condition for scalar input, consistent withchk_gte(),chk_lt()andchk_gt(). -
chk_null_or()now resolves the matchingchk_function by direct lookup (includingchk_/vld_pairs defined in other packages) rather than byparse()/eval(), and falls back to an informative message when no partner can be found (#97).
- Added
chk_complex()andvld_complex(). (#158). - Added
chk_raw()andvld_raw()(#157). - Added
check_length(). - Soft-deprecated
chk_lgl()forchk_scalar()andchk_logical(). - Fixed nested backticks so that error messages only have one set of backticks.
- No longer officially supports R 3.6 as dependency
evaluateof suggested dependencytestthatswitched to 4.0. check_key()now preserves active status ofsfccolumn ofsfobject.- Fixed
vld_join(by = NULL)with R 4.5.
- Fixes incorrect error message with
chk_null_or()whenvld = chk::vld_xx.
- Added
chk_compatible_lengths()andvld_compatible_lengths()to check that lengths of objects are 'strictly recyclable'. - Added
inclusive = TRUEargument tochk_range(). - Added
upperargument tochk_length(). vld_sorted()andchk_sorted()now ignore missing values.- Soft deprecated
.subclassforclassargument inerr(),wrn()andmsg().
- Fixed bug where
check_key()failing on sf objects.
- Updated deprecated argument
.subclasstoclassin rlang function calls - Added
chk_valid_name(). - Fixed
chk_join()withsfdata frames.
- Added
chkor_vld()as faster replacement for soft-deprecatedchkor(). - Sped up
chk_null_or()by soft-deprecatingchkargument forvldargument. - Un-deprecated
chk_count()andchk_length()because so useful. - Updated error messages to precede objects which are described by their class by 'the y object of class'.
chk_null_or()now returns (invisible) x.
- Soft deprecated
chkor()forchkor_vld()as slow. - Soft deprecated
chkargument ofchk_null_or()forvldargument. - Soft deprecated
chk_chr(),chk_dbl()andchk_wnum()andvld_equivalents. - Warn deprecated
chk_count(),chk_dirs(),chk_files(),chk_has(),chk_in(),chk_length(),chk_no_missing(),vld_no_missing(),chk_proportion() - Stop deprecated
chk_off(),chk_on(),is_chk_on(),
- All
chk_xx()functions now return invisible copy of x (if passes check). - Fixed bug in
check_key()andcheck_data()when key is undefined forsfobjects. chk_whole_numeric()now acceptsInfvalues.- Removed
LazyData: truefor DESCRIPTION file to avoid CRAN check note.
-
Added
chk_null_or(). -
Added
chk_wnum()to check whole numeric scalars. -
Added
chk_dbl()to check double scalars. -
Added
chk_chr()to check character scalars. -
Added
chk_not_subset()to check not a subset. -
Added
chk_factor()to check factor vector. -
Added
chk_character_or_factor()factor or character vector. -
Added
check_files()andcheck_dirs()to check if all files or directories exist (or not). -
Added
chk_setordered()to check order of elements in set. -
check_values()now checks factor levels. -
Undeprecated
chk_is()as useful for R6 objects. -
Soft-deprecated
chk_datetime()forchk_date_time().
-
Added following checks
check_names().check_dim().check_values().check_key().check_data().
-
Added following typeof chks
chk_logical()andvld_logical().chk_double()andvld_double().chk_integer()andvld_integer().chk_character()andvld_character().
-
Added miscellaneous chks
chk_data()andvld_data().chk_join().
-
Fixed
chk_vector()andvld_vector()so ignores attributes.
- Added
expect_chk_error(). - Added
chk_matrix()andvld_matrix(). - Added
chk_array()andvld_array(). abort_chknow allows original arguments to be attached.- Added
chk_tz()andvld_tz(). - Added
chk_matrix()andvld_matrix(). - Added
chk_array()andvld_array(). - Added
expect_chk_error().
- Added
chk_sorted()andvld_sorted().
- Removed
chk-benchmarking.Rmdvignette that was causing problems for many CRAN checks.
- Added
x_name = NULLargument to relevantchk_functions. - Replaced
err = FALSEvariant withvld_variant. - Switched from
stop(),warning()andmessage()to rlang variantsabort(),warn()andinform(). - All error messages now start with x_name.
- Err capitalizes first character and adds missing period (tidyverse style).
chk_all()chk_atomic()chk_environment()chk_ext()chk_has()chk_not_empty()chk_s3_class()chk_s4_class()chk_setequal()
backtick_chk()unbacktick_chk().
formalsargument tochk_function().tidy = TRUEargument to errors, warnings and messages.n = NULLandcall. = FALSEargs to error message generating functions.ellipsis = 10Largument tocc().sep = ", "arg tocc().incomparables = FALSEargument tochk_unique().%yto sprintf-like types.
-
chk_no_missing()forchk_not_any_na(). -
chk_files()andchk_dirs()forchk_all(x, chk_file)etc. -
deparse_backtick()fordeparse_backtick_chk(). -
chk_length(),chk_proportion()andchk_count(). -
chk_on(),chk_off()andis_chk_on().
- Changed
chk_match()so ignores missing values. - Changed
chk_true()(andchk_false()) to same behavior asisTRUEin R >= 3.5. - Extended
chk_unique()to handleincomparables != FALSEwith data frames. - Changed to
range = c(0,1)forchk_range().
- Initial release.