# Test a simple example
json <- '[1, "string", true, [1, 2], {"name": "value"}, null]' %>% gather_array
json %>% is_json_number
json %>% is_json_array
json %>% is_json_scalar
# Use with filter
library(dplyr)
json %>% filter(is_json_object(.))
# Combine with filter in advance of using gather_array
companies[1:5] %>% gather_object %>% filter(is_json_array(.))
companies[1:5] %>% gather_object %>% filter(is_json_array(.)) %>%
gather_array
# Combine with filter in advance of using gather_object
companies[1:5] %>% gather_object %>% filter(is_json_object(.))
companies[1:5] %>% gather_object %>% filter(is_json_object(.)) %>%
gather_object("name2")
Run the code above in your browser using DataLab