|
1 |
| ---- |
2 |
| -title: "patentsview" |
3 |
| -output: github_document |
4 |
| ---- |
| 1 | +patentsview |
| 2 | +================ |
5 | 3 |
|
| 4 | +# patentsview <img src="man/figures/logo.png" align="right" height="200" style="float:right; height:200px;" alt="Package Logo"/> |
6 | 5 |
|
7 |
| - |
8 |
| -# patentsview <img src="man/figures/logo.png" align="right" height="200" style="float:right; height:200px;" /> |
9 | 6 | > An R client to the PatentsView API
|
10 | 7 |
|
11 | 8 | [](https://github.com/ropensci/software-review/issues/112)
|
12 | 9 | [](https://github.com/ropensci/patentsview/actions)
|
13 |
| -[](https://cran.r-project.org/package=patentsview) |
| 10 | +[](https://cran.r-project.org/package=patentsview) |
14 | 12 | [](https://mustberuss.r-universe.dev/ui#package:patentsview)
|
15 | 13 |
|
16 |
| -This is the R package for the new beta version of the patentsview API |
17 |
| -To get a sense of what's going on with the API, check out the following |
18 |
| - |
19 |
| -* the skips() in the unit tests test/testthat/*.R |
20 |
| -* the try/catch block in test/testthat/test-fetch-each-field.R |
21 |
| -* comments in data-raw/openAPI_to_csv.pl |
22 |
| - |
23 |
| - |
24 | 14 | ## Installation
|
25 | 15 |
|
26 |
| -You can get the stable version for the original version of the API from CRAN: |
27 |
| - |
| 16 | +You can get the stable version for the original version of the API from |
| 17 | +CRAN: |
28 | 18 |
|
29 |
| -```r |
| 19 | +``` r |
30 | 20 | install.packages("patentsview")
|
31 | 21 | ```
|
32 | 22 |
|
33 | 23 | Or the development version from GitHub:
|
34 | 24 |
|
35 |
| - |
36 |
| -```r |
| 25 | +``` r |
37 | 26 | if (!"devtools" %in% rownames(installed.packages())) {
|
38 | 27 | install.packages("devtools")
|
39 | 28 | }
|
40 | 29 |
|
41 | 30 | devtools::install_github("ropensci/patentsview")
|
42 | 31 | ```
|
| 32 | + |
43 | 33 | Or the R package for the new version of the API from github:
|
44 |
| -``` |
45 |
| -if (!"devtools" %in% rownames(installed.packages())) { |
46 |
| - devtools::install_github("ropensci/patentsview@api-redesign") |
47 |
| -} |
48 |
| -``` |
49 |
| -Or the R package for the new version of the API from r-universe: |
50 | 34 |
|
| 35 | + if (!"devtools" %in% rownames(installed.packages())) { |
| 36 | + devtools::install_github("ropensci/patentsview@api-redesign") |
| 37 | + } |
51 | 38 |
|
52 |
| -```r |
| 39 | +Or the R package for the new version of the API from r-universe: |
| 40 | + |
| 41 | +``` r |
53 | 42 | options(repos = c(
|
54 | 43 | patentsview = "https://mustberuss.r-universe.dev/",
|
55 | 44 | CRAN = "https://cloud.r-project.org"
|
56 | 45 | ))
|
57 | 46 |
|
58 | 47 | install.packages("patentsview")
|
59 | 48 | ```
|
| 49 | + |
60 | 50 | ## Important API Change
|
61 | 51 |
|
62 |
| -The new version of the API requires an api key, or all of your requests will be blocked. An API key can be optained [here](https://patentsview-support.atlassian.net/servicedesk/customer/portal/1/group/1/create/18). The updated R package will look for an environmental variable PATENTSVIEW_API_KEY set to the value of your key. For windows it would be |
63 |
| -``` |
64 |
| -set PATENTSVIEW_API_KEY=my_keys_value_without quotes |
65 |
| -``` |
| 52 | +The new version of the API requires an api key, or all of your requests |
| 53 | +will be blocked. An API key can be optained |
| 54 | +[here](https://patentsview.org/apis/keyrequest). The updated R package |
| 55 | +will look for an environmental variable PATENTSVIEW_API_KEY set to the |
| 56 | +value of your key. For windows it would be |
66 | 57 |
|
67 |
| -See [this page](https://mustberuss.github.io/patentsview/articles/api-changes.html) about the change. The navigation there will get you to the updated vignettes and reference pages. |
| 58 | + set PATENTSVIEW_API_KEY=my_keys_value_without quotes |
68 | 59 |
|
69 |
| -## Basic usage |
| 60 | +See [this |
| 61 | +page](https://mustberuss.github.io/patentsview/articles/api-changes.html) |
| 62 | +about the change. The navigation there will get you to the updated |
| 63 | +vignettes and reference pages. |
70 | 64 |
|
71 |
| -The [PatentsView API](https://patentsview.org/apis/api-endpoints) provides an interface to a disambiguated version of USPTO. The `patentsview` R package provides one main function, `search_pv()`, to make it easy to interact with the API: |
| 65 | +## Basic usage |
72 | 66 |
|
| 67 | +The [PatentsView API](https://patentsview.org/apis/api-endpoints) |
| 68 | +provides an interface to a disambiguated version of USPTO. The |
| 69 | +`patentsview` R package provides one main function, `search_pv()`, to |
| 70 | +make it easy to interact with the API: |
73 | 71 |
|
74 |
| -```r |
| 72 | +``` r |
75 | 73 | library(patentsview)
|
76 | 74 |
|
77 | 75 | search_pv(query = '{"_gte":{"patent_date":"2007-01-01"}}')
|
78 | 76 | #> $data
|
79 | 77 | #> #### A list with a single data frame on patents level:
|
80 | 78 | #>
|
81 | 79 | #> List of 1
|
82 |
| -#> $ patents:'data.frame': 1000 obs. of 3 variables: |
| 80 | +#> $ patents:'data.frame': 1000 obs. of 3 variables: |
83 | 81 | #> ..$ patent_id : chr [1:1000] "10000000" ...
|
84 | 82 | #> ..$ patent_title: chr [1:1000] "Coherent LADAR using intra-pixel quadrature"..
|
85 | 83 | #> ..$ patent_date : chr [1:1000] "2018-06-19" ...
|
86 | 84 | #>
|
87 | 85 | #> $query_results
|
88 | 86 | #> #### Distinct entity counts across all downloadable pages of output:
|
89 | 87 | #>
|
90 |
| -#> total_hits = 4,642,018 |
| 88 | +#> total_hits = 5,362,291 |
91 | 89 | ```
|
92 | 90 |
|
93 | 91 | ## Learning more
|
94 | 92 |
|
95 |
| -Head over to the package's [webpage](https://docs.ropensci.org/patentsview/index.html) for more info, including: |
96 |
| - |
97 |
| -* A [getting started vignette](https://docs.ropensci.org/patentsview/articles/getting-started.html) for first-time users. The package was also introduced in an [rOpenSci blog post](https://ropensci.org/blog/2017/09/19/patentsview/). |
98 |
| -* An in-depth tutorial on [writing queries](https://docs.ropensci.org/patentsview/articles/writing-queries.html) |
99 |
| -* A list of [basic examples](https://docs.ropensci.org/patentsview/articles/examples.html) |
100 |
| -* Two examples of data applications (e.g., a brief analysis of the [top assignees](https://docs.ropensci.org/patentsview/articles/top-assignees.html) in the field of databases) |
| 93 | +Head over to the package’s |
| 94 | +[webpage](https://docs.ropensci.org/patentsview/index.html) for more |
| 95 | +info, including: |
| 96 | + |
| 97 | +- A [getting started |
| 98 | + vignette](https://docs.ropensci.org/patentsview/articles/getting-started.html) |
| 99 | + for first-time users. The package was also introduced in an |
| 100 | + [rOpenSci blog |
| 101 | + post](https://ropensci.org/blog/2017/09/19/patentsview/). |
| 102 | +- An in-depth tutorial on [writing |
| 103 | + queries](https://docs.ropensci.org/patentsview/articles/writing-queries.html) |
| 104 | +- A list of [basic |
| 105 | + examples](https://docs.ropensci.org/patentsview/articles/examples.html) |
| 106 | +- Two examples of data applications (e.g., a brief analysis of the |
| 107 | + [top |
| 108 | + assignees](https://docs.ropensci.org/patentsview/articles/top-assignees.html) |
| 109 | + in the field of databases) |
0 commit comments