Learn R Programming

chk (version 0.2.0)

chk_deprecated: Deprecated functions

Description

Deprecated chk_() functions.

Usage

chk_dirs(x)

chk_files(x)

chk_length(x, length = 1L, x_name = NULL)

chk_count(x, x_name = NULL)

chk_proportion(x, x_name = NULL)

chk_in(x, values, x_name = NULL)

chk_has(x, values, x_name = NULL)

chk_is(x, class, x_name = NULL)

vld_is(x, class)

chk_no_missing(x, x_name = NULL)

vld_no_missing(x)

chk_on()

chk_off()

is_chk_on()

Arguments

x

The object to check.

length

A count of the length.

x_name

A string of the name of object x or NULL.

Functions

  • chk_dirs: Check Directories Exist

    soft-deprecated

    Checks if directories exist using:

    all(dir.exists(x))

    Replace by chk_dir().

  • chk_files: Check Files Exist

    soft-deprecated

    Checks if files exist using:

    all(file.exists(x) && !dir.exists(x))

    Replace by chk_file().

  • chk_length: Check Length

    deprecated

    Checks if is length length using:

    length(x) == length

    length should be a count.

    Replace by [chk_range](length(x)).

  • chk_count: Check Count

    deprecated

    Checks if non-missing non-negative integer scalar or double equivalent using:

    is.numeric(x) && length(x) == 1L && !anyNA(x) && x >= 0 && vld_true(all.equal(x, as.integer(x)))

    Replace by chk_whole_number() and chk_gte().

  • chk_proportion: Check Proportion

    deprecated

    Checks if non-missing numeric scalar between 0 and 1 using:

    is.numeric(x) && length(x) == 1L && !anyNA(x) && x >= 0 && x <= 1

    Replace by chk_number() and chk_range().

  • chk_in: Check In

    soft-deprecated

    Checks if all values in values using chk_subset().

    Replace by chk_subset().

  • chk_has: Check Has

    soft-deprecated

    Checks if includes all values using chk_superset().

    Replace by chk_superset().

  • chk_is: Check Is

    soft-deprecated

    Checks if inherits from class using vld_is().

    Replace by chk_s3_class() or chk_s4_class().

  • vld_is: Validate Is

    soft-deprecated

    Validates inherits from class using

    inherits(x, class)

    Class should be a string.

  • chk_no_missing: Check No Missing Values

    Checks if no missing values using vld_no_missing().

  • vld_no_missing: Validate No Missing Values

    Validates no missing values using

    !anyNA(x).

  • chk_on: Turns checking on

    soft-deprecated

  • chk_off: Turns checking off

    soft-deprecated

  • is_chk_on: Tests checking on

    soft-deprecated

See Also

anyNA()

Examples

Run this code
# NOT RUN {
# chk_is
chk_is(1, "numeric")
try(chk_is(1, "character"))

# vld_is
vld_is(numeric(0), "numeric")
vld_is(1, "numeric")
vld_is(NA_real_, "numeric")
vld_is(1, "character")
vld_is(NULL, "numeric")

# chk_no_missing
chk_no_missing(1)
try(chk_no_missing(c(1, NA)))

# vld_no_missing
vld_no_missing(character(0))
vld_no_missing(1)
vld_no_missing(1:10)
vld_no_missing(NA)
vld_no_missing(c(1, NA))
# }

Run the code above in your browser using DataLab