Description Usage Arguments Details Examples
The append_values_X functions let you take any remaining JSON and add it as a column X (for X in "string", "number", "logical") insofar as it is of the JSON type specified.
1 2 3 4 5 6 7 8 | append_values_string(x, column.name = type, force = TRUE,
recursive = FALSE)
append_values_number(x, column.name = type, force = TRUE,
recursive = FALSE)
append_values_logical(x, column.name = type, force = TRUE,
recursive = FALSE)
|
x |
a tbl_json object |
column.name |
the column.name to append the values into the data.frame under |
force |
parameter that determines if the variable type should be computed or not if force is FALSE, then the function may take more memory |
recursive |
logical indicating whether to extract a single value from a nested object. Only used when force = TRUE. If force = FALSE, and recursive=TRUE, throws an error. |
Any values that do not conform to the type specified will be NA in the resulting column. This includes other scalar types (e.g., numbers or logicals if you are using append_values_string) and *also* any rows where the JSON is still an object or an array.
1 2 3 4 | library(magrittr) # for %>%
'{"first": "bob", "last": "jones"}' %>%
gather_keys() %>%
append_values_string()
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.