Download one of the bulk tables from PatentsView, and optionally make an Arrow dataset from it.

download_patentsview_bulk(table, dir = tempdir(), pregrant = FALSE,
  partition = NULL, make_db = FALSE, format = "parquet",
  return_table = TRUE, ..., overwrite = FALSE)

Arguments

table

Name of the table to download, as listed on the Data Downloads page.

dir

Directory in which to save original tables and the dataset if make_db is TRUE.

pregrant

Logical; if TRUE, will download the pre-grant version of table.

partition

A vector of column names to be used as partition keys, if make_db is TRUE. Can be a named list of functions, which will be used to create new columns, then partition by those columns (e.g., list(series_code = function(d) substr(d$patent_id, 1, 2))). If NULL not specified, will choose a column with the number of unique values closest to 20.

make_db

Logical; if TRUE, will make an Arrow dataset out of the downloaded table.

format

Format of the dataset, if make_db is TRUE.

return_table

Logical; if FALSE, returns the path to the file, rather than the read-in table.

...

Passes additional arguments to vroom when reading in tables.

overwrite

Logical; if TRUE, overwrites any existing files (raw and prepared).

Value

The original table (if return_table is TRUE; as a tibble), an opened dataset (if the path to the dataset exists), or the path to the downloaded file.

Examples

if (FALSE) {
# download the application table of granted patents
download_patentsview_bulk(".", "application", partition = "series_code")
}