diff --git a/R/search-pv.R b/R/search-pv.R index b01517fa..4077d2de 100644 --- a/R/search-pv.R +++ b/R/search-pv.R @@ -186,15 +186,20 @@ request_apply <- function(ex_res, method, query, base_url, arg_list, #' } #' #' @examples -#' search_pv(query = qry_funs$gt(patent_year = 2010)) +#' search_pv(query = '{"_gt":{"patent_year":2010}}') #' -#' search_pv(query = '{"_gt":{"patent_year":2010}}', +#' search_pv(query = qry_funs$gt(patent_year = 2010), +#' fields = get_fields("patents", c("patents", "assignees"))) +#' +#' search_pv(query = qry_funs$gt(patent_year = 2010), #' method = "POST", fields = "patent_number", #' sort = c("patent_number" = "asc")) #' +#' search_pv(query = qry_funs$eq(inventor_last_name = "crew"), +#' all_pages = TRUE) +#' #' search_pv(query = qry_funs$contains(inventor_last_name = "smith"), -#' endpoint = "assignees", -#' fields = get_fields("assignees", c("assignees", "patents"))) +#' endpoint = "assignees") #' #' search_pv(query = qry_funs$contains(inventor_last_name = "smith"), #' config = httr::timeout(40)) diff --git a/docs/reference/search_pv.html b/docs/reference/search_pv.html index 629e26e7..b4dd63e7 100644 --- a/docs/reference/search_pv.html +++ b/docs/reference/search_pv.html @@ -260,7 +260,7 @@

Value

Examples

-
search_pv(query = qry_funs$gt(patent_year = 2010))
#> $data +
search_pv(query = '{"_gt":{"patent_year":2010}}')
#> $data #> #### A list with a single data frame on the patent data level: #> #> List of 1 @@ -273,7 +273,49 @@

Examp #> #### Distinct entity counts across all downloadable pages of output: #> #> total_patent_count = 100,000

-search_pv(query = '{"_gt":{"patent_year":2010}}', +search_pv(query = qry_funs$gt(patent_year = 2010), + fields = get_fields("patents", c("patents", "assignees")))
#> $data +#> #### A list with a single data frame (with list column(s) inside) on the patent data level: +#> +#> List of 1 +#> $ patents:'data.frame': 25 obs. of 31 variables: +#> ..$ patent_abstract : chr [1:25] "A nose cover or nose protector, for adventurers, sports fans, and people who love outdoor activities, comprises"| __truncated__ ... +#> ..$ patent_average_processing_time : chr [1:25] "1088" ... +#> ..$ patent_date : chr [1:25] "2011-01-04" ... +#> ..$ patent_firstnamed_assignee_city : chr [1:25] NA ... +#> ..$ patent_firstnamed_assignee_country : chr [1:25] NA ... +#> ..$ patent_firstnamed_assignee_id : chr [1:25] NA ... +#> ..$ patent_firstnamed_assignee_latitude : chr [1:25] NA ... +#> ..$ patent_firstnamed_assignee_location_id: chr [1:25] NA ... +#> ..$ patent_firstnamed_assignee_longitude : chr [1:25] NA ... +#> ..$ patent_firstnamed_assignee_state : chr [1:25] NA ... +#> ..$ patent_firstnamed_inventor_city : chr [1:25] "San Pedro" ... +#> ..$ patent_firstnamed_inventor_country : chr [1:25] "US" ... +#> ..$ patent_firstnamed_inventor_id : chr [1:25] "7861317-1" ... +#> ..$ patent_firstnamed_inventor_latitude : chr [1:25] "33.7358" ... +#> ..$ patent_firstnamed_inventor_location_id: chr [1:25] "33.7358333|-118.2913889" ... +#> ..$ patent_firstnamed_inventor_longitude : chr [1:25] "-118.291" ... +#> ..$ patent_firstnamed_inventor_state : chr [1:25] "CA" ... +#> ..$ patent_id : chr [1:25] "7861317" ... +#> ..$ patent_kind : chr [1:25] "B2" ... +#> ..$ patent_number : chr [1:25] "7861317" ... +#> ..$ patent_num_cited_by_us_patents : chr [1:25] "2" ... +#> ..$ patent_num_claims : chr [1:25] "9" ... +#> ..$ patent_num_combined_citations : chr [1:25] "12" ... +#> ..$ patent_num_foreign_citations : chr [1:25] "0" ... +#> ..$ patent_num_us_application_citations : chr [1:25] "0" ... +#> ..$ patent_num_us_patent_citations : chr [1:25] "12" ... +#> ..$ patent_processing_time : chr [1:25] "2279" ... +#> ..$ patent_title : chr [1:25] "Nose cover" ... +#> ..$ patent_type : chr [1:25] "utility" ... +#> ..$ patent_year : chr [1:25] "2011" ... +#> ..$ assignees :List of 25 +#> +#> $query_results +#> #### Distinct entity counts across all downloadable pages of output: +#> +#> total_patent_count = 100,000
+search_pv(query = qry_funs$gt(patent_year = 2010), method = "POST", fields = "patent_number", sort = c("patent_number" = "asc"))
#> $data #> #### A list with a single data frame on the patent data level: @@ -286,30 +328,30 @@

Examp #> #### Distinct entity counts across all downloadable pages of output: #> #> total_patent_count = 100,000

+search_pv(query = qry_funs$eq(inventor_last_name = "crew"), + all_pages = TRUE)
#> $data +#> #### A list with a single data frame on the patent data level: +#> +#> List of 1 +#> $ patents:'data.frame': 97 obs. of 3 variables: +#> ..$ patent_id : chr [1:97] "3961846" ... +#> ..$ patent_number: chr [1:97] "3961846" ... +#> ..$ patent_title : chr [1:97] "Ultra-high reduction microfiche layout and positioning mechanism therefor" ... +#> +#> $query_results +#> #### Distinct entity counts across all downloadable pages of output: +#> +#> total_patent_count = 97
search_pv(query = qry_funs$contains(inventor_last_name = "smith"), - endpoint = "assignees", - fields = get_fields("assignees", c("assignees", "patents")))
#> $data -#> #### A list with a single data frame (with list column(s) inside) on the assignee data level: + endpoint = "assignees")
#> $data +#> #### A list with a single data frame on the assignee data level: #> #> List of 1 -#> $ assignees:'data.frame': 25 obs. of 17 variables: -#> ..$ assignee_first_name : logi [1:25] NA ... -#> ..$ assignee_first_seen_date : chr [1:25] "1976-03-09" ... -#> ..$ assignee_id : chr [1:25] "000fd451e3903862279995c8f7946893" ... -#> ..$ assignee_key_id : chr [1:25] "85" ... -#> ..$ assignee_lastknown_city : chr [1:25] "Mississauga" ... -#> ..$ assignee_lastknown_country : chr [1:25] "CA" ... -#> ..$ assignee_lastknown_latitude : chr [1:25] "43.15" ... -#> ..$ assignee_lastknown_location_id: chr [1:25] "43.15|-79.5" ... -#> ..$ assignee_lastknown_longitude : chr [1:25] "-79.5" ... -#> ..$ assignee_lastknown_state : chr [1:25] "Ontario" ... -#> ..$ assignee_last_name : logi [1:25] NA ... -#> ..$ assignee_last_seen_date : chr [1:25] "1981-01-06" ... -#> ..$ assignee_organization : chr [1:25] "Ferranti-Packard Limited" ... -#> ..$ assignee_total_num_inventors : chr [1:25] "5" ... -#> ..$ assignee_total_num_patents : chr [1:25] "11" ... -#> ..$ assignee_type : chr [1:25] "3" ... -#> ..$ patents :List of 25 +#> $ assignees:'data.frame': 25 obs. of 4 variables: +#> ..$ assignee_id : chr [1:25] "000fd451e3903862279995c8f7946893" ... +#> ..$ assignee_first_name : logi [1:25] NA ... +#> ..$ assignee_last_name : logi [1:25] NA ... +#> ..$ assignee_organization: chr [1:25] "Ferranti-Packard Limited" ... #> #> $query_results #> #### Distinct entity counts across all downloadable pages of output: diff --git a/man/search_pv.Rd b/man/search_pv.Rd index e59d7129..c41a2885 100644 --- a/man/search_pv.Rd +++ b/man/search_pv.Rd @@ -120,15 +120,20 @@ This function makes an HTTP request to the PatentsView API for data matching the user's query. } \examples{ -search_pv(query = qry_funs$gt(patent_year = 2010)) +search_pv(query = '{"_gt":{"patent_year":2010}}') -search_pv(query = '{"_gt":{"patent_year":2010}}', +search_pv(query = qry_funs$gt(patent_year = 2010), + fields = get_fields("patents", c("patents", "assignees"))) + +search_pv(query = qry_funs$gt(patent_year = 2010), method = "POST", fields = "patent_number", sort = c("patent_number" = "asc")) +search_pv(query = qry_funs$eq(inventor_last_name = "crew"), + all_pages = TRUE) + search_pv(query = qry_funs$contains(inventor_last_name = "smith"), - endpoint = "assignees", - fields = get_fields("assignees", c("assignees", "patents"))) + endpoint = "assignees") search_pv(query = qry_funs$contains(inventor_last_name = "smith"), config = httr::timeout(40))