Add a column that tells the 'type' of the data in the root of the JSON

Description

The function json_types() inspects the JSON associated with each row of the tbl_json data.frame, and adds a new column ("type" by default) that identifies the type according to the JSON standard at http://json.org/.

Usage

1
json_types(x, column.name = "type")

Arguments

x

a tbl_json object

column.name

the name to specify for the type column

Details

This is particularly useful for inspecting your JSON data types, and can added after gather_array() (or gather_keys()) to inspect the types of the elements (or values) in arrays (or objects).

Value

a tbl_json object with column.name column that tells the type

Examples

1
2
library(magrittr)  # for %>%
c('{"a": 1}', '[1, 2]', '"a"', '1', 'true', 'null') %>% json_types

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.