# A simple example
json <- c('[1, 2, [3, 4]]', '{"k1": 1, "k2": [2, [3, 4]]}', '1', 'null')
# Complexity is larger than length for nested objects
json %>% json_lengths %>% json_complexity
# Worldbank has complexity ranging from 8 to 17
library(magrittr)
worldbank %>% json_complexity %$% table(complexity)
# Commits are much more regular
commits %>% gather_array %>% json_complexity %$% table(complexity)
Run the code above in your browser using DataLab