Compute the depth of a vector
The depth of a vector is basically how many levels that you can index into it.
vec_depth(x)
x |
A vector |
An integer.
x <- list( list(), list(list()), list(list(list(1))) ) vec_depth(x) x %>% map_int(vec_depth)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.