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

depth(x)

## Arguments

x A vector

An integer.

## Examples

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