Description Usage Arguments Value Examples
View source: R/unnest-pv-data.R
This function converts a single data frame that has subentity-level list columns in it into multiple data frames, one for each entity/subentity. The multiple data frames can be merged together using the primary key variable specified by the user (see the relational data chapter in "R for Data Science" for an in-depth introduction to joining tabular data).
1 | unnest_pv_data(data, pk = get_ok_pk(names(data)))
|
data |
The data returned by |
pk |
The column/field name that will link the data frames together. This
should be the unique identifier for the primary entity. For example, if you
used the patents endpoint in your call to |
A list with multiple data frames, one for each entity/subentity.
Each data frame will have the pk
column in it, so you can link the
tables together as needed.
1 2 3 4 5 6 7 | ## Not run:
fields <- c("patent_number", "patent_title", "inventor_city", "inventor_country")
res <- search_pv(query = '{"_gte":{"patent_year":2015}}', fields = fields)
unnest_pv_data(data = res$data, pk = "patent_number")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.