powered by
The depth of a vector is basically how many levels that you can index into it.
vec_depth(x)
A vector
An integer.
# NOT RUN { x <- list( list(), list(list()), list(list(list(1))) ) vec_depth(x) x %>% map_int(vec_depth) # }
Run the code above in your browser using DataLab