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".

vec_is_list(x)

Arguments

x

An object.

Details

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

If x inherits explicitly from "list", it is also required that the proxy returned by vec_proxy() is a list. If it is not, an error is thrown.

Examples

#> [1] TRUE
#> [1] TRUE
#> [1] FALSE