Description Usage Arguments Examples
The spread_values() function lets you dive into (potentially nested) JSON objects and extract specific values. spread_values() takes jstring(), jnumber() or jlogical() named function calls as arguments in order to specify the type of the data that should be captured at each desired key location. These values can be of varying types at varying depths.
1 | spread_values(x, ...)
|
x |
tbl_json object |
... |
column=value list where 'column' will be the column name created and 'value' must be a call to jstring(), jnumber() or jlogical() specifying the path to get the value (and the type implicit in the function name) |
1 2 3 4 5 6 | library(magrittr) # for %>%
'{"name": {"first": "bob", "last": "jones"}, "age": 32}' %>%
spread_values(
first.name = jstring("name", "first"),
age = jnumber("age")
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.