5
5
6
6
<!-- badges: start -->
7
7
8
- [ ![ R-CMD-check ] ( https://github.com/simpar1471/openFDA/actions/workflows/R-CMD-check.yaml/badge.svg )] ( https://github.com/simpar1471/openFDA/actions/workflows/R-CMD-check.yaml )
9
- [ ![ Project Status: WIP – Initial development is in progress, but there
10
- has not yet been a stable, usable release suitable for the
11
- public. ] ( https://www.repostatus.org/badges/latest/wip .svg )] ( https://www.repostatus.org/#wip )
8
+ [ ![ CRAN
9
+ status ] ( https://www.r-pkg.org/badges/version/openFDA )] ( https://CRAN.R-project.org/package=openFDA )
10
+ [ ![ R-CMD-check ] ( https://github.com/simpar1471/openFDA/actions/workflows/R-CMD-check/badge.svg )] ( https://github.com/simpar1471/openFDA/actions/workflows/R-CMD-check.yaml )
11
+ [ ![ R-CMD-check-no-suggests ] ( https://github.com/simpar1471/openFDA/actions/workflows/check-no-suggests/badge .svg )] ( https://github.com/simpar1471/openFDA/actions/workflows/check-no-suggests.yaml )
12
12
[ ![ Codecov test
13
13
coverage] ( https://codecov.io/gh/simpar1471/openFDA/graph/badge.svg )] ( https://app.codecov.io/gh/simpar1471/openFDA )
14
14
<!-- badges: end -->
@@ -22,18 +22,19 @@ validated for clinical or production use.
22
22
23
23
## Installation
24
24
25
- You can install the development version of openFDA from GitHub using
26
- either [ pak] ( https://pak.r-lib.org/ ) or
27
- [ devtools] ( https://devtools.r-lib.org/ ) :
28
-
29
25
``` r
30
- # install.packages("pak")
31
- pak :: pkg_install( " simpar1471/ openFDA" )
26
+ # The easiest way to get openFDA is to install it from CRAN:
27
+ install.packages( " openFDA" )
32
28
```
33
29
30
+ ### Dev version
31
+
32
+ Alternatively, you can install the development version of openFDA from
33
+ GitHub using either [ pak] ( https://pak.r-lib.org/ ) :
34
+
34
35
``` r
35
- # install.packages("devtools ")
36
- devtools :: install_github (" simpar1471/openFDA" )
36
+ # install.packages("pak ")
37
+ pak :: pkg_install (" simpar1471/openFDA" )
37
38
```
38
39
39
40
## Using openFDA
61
62
# > https://api.fda.gov/drug/drugsfda.json?api_key=[API_KEY]&search=openfda.generic_name:furosemide&limit=5
62
63
# > Status: 200 OK
63
64
# > Content-Type: application/json
64
- # > Body: In memory (17286 bytes)
65
+ # > Body: In memory (26060 bytes)
65
66
```
66
67
67
68
The underlying response is JSON data - you can use
@@ -73,7 +74,7 @@ json <- httr2::resp_body_json(search)
73
74
74
75
json $ results [[1 ]]$ openfda $ brand_name
75
76
# > [[1]]
76
- # > [1] "FUROSEMIDE "
77
+ # > [1] "FUROSCIX "
77
78
json $ results [[1 ]]$ openfda $ pharm_class_epc
78
79
# > [[1]]
79
80
# > [1] "Loop Diuretic [EPC]"
@@ -87,9 +88,11 @@ purrr::map_chr(
87
88
.x = json $ results ,
88
89
.f = \(result ) purrr :: pluck(result , " openfda" , " manufacturer_name" , 1 )
89
90
)
90
- # > [1] "Amneal Pharmaceuticals LLC" "Gland Pharma Limited"
91
- # > [3] "Solco Healthcare LLC" "Lifestar Pharma LLC"
92
- # > [5] "Ipca Laboratories Limited"
91
+ # > [1] "scPharmaceuticals Inc."
92
+ # > [2] "Graviti Pharmaceuticals Private Limited"
93
+ # > [3] "Hikma Pharmaceuticals USA Inc."
94
+ # > [4] "Civica, Inc."
95
+ # > [5] "Eugia US LLC"
93
96
```
94
97
95
98
## Other R packages for openFDA
0 commit comments