bare-type-predicates

0th

Percentile

Bare type predicates

These predicates check for a given type but only return TRUE for bare R objects. Bare objects have no class attributes. For example, a data frame is a list, but not a bare list.

Usage
is_bare_list(x, n = NULL)

is_bare_atomic(x, n = NULL)

is_bare_vector(x, n = NULL)

is_bare_double(x, n = NULL)

is_bare_integer(x, n = NULL)

is_bare_numeric(x, n = NULL)

is_bare_character(x, n = NULL, encoding = NULL)

is_bare_logical(x, n = NULL)

is_bare_raw(x, n = NULL)

is_bare_string(x, n = NULL)

is_bare_bytes(x, n = NULL)

Arguments
x

Object to be tested.

n

Expected length of a vector.

encoding

Expected encoding of a string or character vector. One of UTF-8, latin1, or unknown.

Details

  • The predicates for vectors include the n argument for pattern-matching on the vector length.

  • Like is_atomic() and unlike base R is.atomic(), is_bare_atomic() does not return TRUE for NULL.

  • Unlike base R is.numeric(), is_bare_double() only returns TRUE for floating point numbers.

See Also

type-predicates, scalar-type-predicates

Aliases
  • bare-type-predicates
  • is_bare_list
  • is_bare_atomic
  • is_bare_vector
  • is_bare_double
  • is_bare_integer
  • is_bare_numeric
  • is_bare_character
  • is_bare_logical
  • is_bare_raw
  • is_bare_string
  • is_bare_bytes
Documentation reproduced from package rlang, version 0.1.6, License: GPL-3

Community examples

Looks like there are no examples yet.