has_length

0th

Percentile

How long is an object?

This is a function for the common task of testing the length of an object. It checks the length of an object in a non-generic way: base::length() methods are ignored.

Usage
has_length(x, n = NULL)
Arguments
x

A R object.

n

A specific length to test x with. If NULL, has_length() returns TRUE if x has length greater than zero, and FALSE otherwise.

Aliases
  • has_length
Examples
# NOT RUN {
has_length(list())
has_length(list(), 0)

has_length(letters)
has_length(letters, 20)
has_length(letters, 26)
# }
Documentation reproduced from package rlang, version 0.1.6, License: GPL-3

Community examples

Looks like there are no examples yet.