Description Usage Arguments Details Value Examples
Given a JSON key value structure, like "key1": 1, "key2": 2, the gather_keys() function duplicates the rows of the tbl_json data.frame for every key, adds a new column (default name "key") to capture the key names, and then dives into the JSON values to enable further manipulation with downstream tidyjson functions.
1 | gather_keys(x, column.name = "key")
|
x |
a tbl_json whose JSON attribute should always be an object |
column.name |
the name to give to the column of key names created |
This allows you to *enter into* the keys of the objects just like 'gather_array' let you enter elements of the array.
a tbl_json with a new column (column.name) that captures the keys and JSON attribute of the associated value data
1 2 | library(magrittr) # for %>%
'{"name": "bob", "age": 32}' %>% gather_keys %>% json_types
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.