Skip to contents

Deprecated chk_() functions.

Usage

chk_dirs(x)

chk_files(x)

chk_has(x, values, x_name = NULL)

chk_in(x, values, x_name = NULL)

chk_no_missing(x, x_name = NULL)

vld_no_missing(x)

chk_off()

chk_on()

is_chk_on()

chk_proportion(x, x_name = NULL)

deparse_backtick(x)

Arguments

x

The object to check.

x_name

A string of the name of object x or NULL.

Value

The chk_ functions throw an informative error if the test fails and otherwise return invisibly. vld_no_missing() returns a flag indicating whether x has no missing values and deparse_backtick() returns a string. chk_off(), chk_on() and is_chk_on() are defunct and always throw an error.

Functions

  • chk_dirs(): Check Directories Exist

    [Deprecated]

    Replace with [chk_all](x, [chk_dir])

  • chk_files(): Check Files Exist

    [Deprecated]

    Replace with [chk_all](x, [chk_file])

  • chk_has(): Check Has

    [Deprecated]

    Replace by chk_superset()

  • chk_in(): Check In

    [Deprecated]

    Replace by chk_subset()

  • chk_no_missing(): Check No Missing Values

    [Deprecated]

    Replace with chk_not_any_na()

  • vld_no_missing(): Validate No Missing Values

    [Deprecated]

    Replace with vld_not_any_na()

  • chk_off(): Turns checking off

    [Deprecated]

    This approach is no longer recommended

  • chk_on(): Turns checking on

    [Deprecated]

    This approach is no longer recommended

  • is_chk_on(): Tests checking on

    [Deprecated]

    This approach is no longer recommended

  • chk_proportion(): Check Proportion

    [Deprecated]

    Replace by [chk_number](x); [chk_range](x)

  • deparse_backtick(): Deparse Backtick

    [Deprecated]

    Replace with deparse_backtick_chk()

See also

Other deprecated: chk_chr(), chk_dbl(), chk_wnum()

Examples

# The deprecated functions signal a deprecation warning when called.
chk_has(1:2, 1)
#> Warning: `chk_has()` was deprecated in chk 0.2.0.
#>  Please use `chk_superset()` instead.
chk_in(1, 1:2)
#> Warning: `chk_in()` was deprecated in chk 0.2.0.
#>  Please use `chk_subset()` instead.
chk_no_missing(1)
#> Warning: `chk_no_missing()` was deprecated in chk 0.2.0.
#>  Please use `chk_not_any_na()` instead.
vld_no_missing(1)
#> [1] TRUE
chk_proportion(0.5)
#> Warning: `chk_proportion()` was deprecated in chk 0.2.0.
#>  Please use `chk_number(x)` or `chk_range(x)` instead
deparse_backtick(quote(x))
#> Warning: `deparse_backtick()` was deprecated in chk 0.2.0.
#>  Please use `deparse_backtick_chk()` instead.
#> [1] "`x`"

# The defunct functions always throw an error.
try(chk_on())
#> Error : `chk_on()` was deprecated in chk 0.2.0 and is now defunct.
#>  This approach is no longer recommended