json_types | R Documentation |
The function json_types
inspects the JSON associated with
each row of the tbl_json
object, and adds a new column
("type"
by default) that identifies the type according to the
JSON standard at http://json.org/.
json_types(.x, column.name = "type")
.x |
a json string or tbl_json object |
column.name |
the name to specify for the type column |
This is particularly useful for inspecting your JSON data types, and can
often follows after gather_array
, gather_object
or enter_object
to inspect the types of the elements of
JSON objects or arrays.
a tbl_json
object
# A simple example c('{"a": 1}', '[1, 2]', '"a"', '1', 'true', 'null') %>% json_types # Type distribution in the first 10 companies library(dplyr) companies[1:10] %>% gather_object %>% json_types %>% count(type)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.