Expanded GitHub Actions to test more combinations:
Final checks before requesting release to CRAN
- spell_check()
- check_rhub()
- check_win_devel()
Using {fs} for all file management
try_silently()
with_msgr()
Simplified argument checks and package dependencies
Added the following assertions on type:
assert_type()
: 'x"' must have type type
and optionally length n
.assert_class()
: 'x"' must have class class
and optionally length n
.assert_null()
: 'x' must be NULL
assert_atomic()
: 'x' must be an atomic vector and optionally length n
.assert_vector()
: 'x' must be a vector and optionally length n
.assert_logical()
: 'x' must be a logical vector and optionally length n
.assert_integer()
: 'x' must be an integer vector and optionally length n
.assert_natural()
: 'x' must be an integerish vector and optionally length
n
.assert_double()
: 'x' must be a double vector and optionally length n
.assert_number()
: 'x' must be a numeric vector and optionally length n
.assert_character()
: 'x' must be a character vector and optionally length
n
.assert_factor()
: 'x' must be a factor vector and optionally length n
.assert_list()
: 'x' must be a list and optionally length n
.assert_array()
: 'x' must be an array and optionally have dimension sizes
dims
.assert_matrix()
: 'x' must be a matrix and optionally have number of columns
n_col
and number of rows n_row
.assert_data_frame()
: 'x' must be a data.frame and optionally have number of
columns n_col
and number of rows n_row
.assert_function()
: 'x' must be a functionassert_formula()
: 'x' must be a formulaAdded the following assertions on structure:
assert_empty()
: 'x' must be empty or NULL
.assert_names()
: 'x' must have names and optionally have the specified
names
.assert_length()
: 'x' must have valid length. You can specify the exact
length using n
or the minimum and/or maximum length using n_min
and
n_max
respectively.Added the following assertions on values:
assert_na()
: All elements of 'x' must be NA
.assert_in()
: All elements of 'x' must in specified values
.assert_in_range()
: All elements of 'x' must be in the specified numeric
range.assert_char_length
: All elements of 'x' must have valid character length.
You can specify the exact length using n
or the minimum and/or maximum
length using n_min
and n_max
respectively.Added the following assertions on files:
assert_file()
: 'x' must be an existing fileassert_dir()
: 'x' must be an existing directoryassert_readable()
: 'x' must be a readable directory or fileassert_writeable()
: 'x' must be a writeable directory or fileassert_url()
: 'x' must be a valid URLFixed the range assertion on msg_level
.
Replaced functions that conflict with purrr:
- Replaced is_integerish()
and is_scalar_integerish()
with is_natural()
- Replaced is_numeric()
and is_scalar_numeric()
with is_number()
Added some new predicates:
- is_type()
- is_class()
- is_array()
- is_matrix()
Also tidied up documentation
Added the following function to check type
- is_integerish()
- is_scalar_integerish()
- is_numeric()
- is_scalar_numeric()
- is_factor()
- is_data_frame()
Added or updated the following;
- has_length()
- is_in()
(updated to be vectorised)
- is_in_range()
- has_char_length()
devtools::lint()
to follow tidyverse style guidegh_map()
and gh_pmap()
try_map()
and try_pmap()
to use purrr::map()
and purrr::pmap()
devtools::check()
is_na()
vectorisedsimplify = FALSE
in sapply()
& mapply()
and unlist result insteadtry_pmap()
try_map()
try_catch()
R/on-load.R
in test coverage reportassert()
(and add test for *_if()
functions).onLoad()
not .onAttach()
error()
when checking inputs instead of stopis_function()
predicateassert()
error_if()
warn_if()
info_if()
error()
warn()
info()
has_names()
is_in()
is_writeable()
is_readable()
is_file()
is_dir()
is_url()
is_na()
is_null()
is_data_frame()
is_list()
is_string()
is_character()
is_natural()
is_integer()
is_number()
is_numeric()
is_boolean()
is_logical()
is_scalar()
is_vector()
.onAttach()
function to validate options.onLoad()
function to set environment variables and optionsAdd the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.