View source: R/scraping-parsing.R
transform_json_to_dataframe | R Documentation |
jsonlite::fromJSON
together with some map
, enframe
and unnest_wider
to create a tidy tibble/dataframe.Transform json to a tidy dataframe
Uses jsonlite::fromJSON
together with some map
, enframe
and unnest_wider
to create a tidy tibble/dataframe.
transform_json_to_dataframe(json, unnest_type = "long", keep_name = TRUE)
json |
json string |
unnest_type |
should the dataframe be wide or long? |
keep_name |
default: |
dataframe/tibble
## Not run: res <- httr::GET("https://lobid.org/gnd/search?q=preferredName:Max%20Spohr&format=json") res <- httr::content(res, as = "text") df_from_json <- transform_json_to_dataframe(res, unnest_type = "wide") ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.