Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

vec_is_list

Is the object a list?


Description

vec_is_list() tests if x is considered a list in the vctrs sense. It returns TRUE if:

  • x is a bare list with no class.

  • x is a list explicitly inheriting from "list".

Usage

vec_is_list(x)

Arguments

x

An object.

Details

Notably, data frames and S3 record style classes like POSIXlt are not considered lists.

Examples

vec_is_list(list())
vec_is_list(list_of(1))

vec_is_list(data.frame())

vctrs

Vector Helpers

v0.3.8
MIT + file LICENSE
Authors
Hadley Wickham [aut], Lionel Henry [aut, cre], Davis Vaughan [aut], data.table team [cph] (Radix sort based on data.table's forder() and their contribution to R's order()), RStudio [cph]
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.