R/depth.R

vec_depth.Rd

The depth of a vector is basically how many levels that you can index into it.

vec_depth(x)

A vector

An integer.

x <- list( list(), list(list()), list(list(list(1))) ) vec_depth(x)#> [1] 5x %>% map_int(vec_depth)#> [1] 1 2 4