Skip to content

Commit

Permalink
docs: updating badges
Browse files Browse the repository at this point in the history
  • Loading branch information
simpar1471 committed Oct 17, 2024
1 parent e20e46e commit f3c76c7
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
pull_request:
branches: [main, master]

name: R-CMD-check.yaml
name: R-CMD-check

permissions: read-all

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check-no-suggests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
branches: [main, master]
pull_request:

name: check-no-suggests.yaml
name: check-no-suggests

permissions: read-all

Expand Down
20 changes: 11 additions & 9 deletions README.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ knitr::opts_chunk$set(
# openFDA

<!-- badges: start -->
[![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)
[![Project Status: WIP -- Initial development is in progress, but there has not yet been a stable, usable release suitable for the public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![CRAN status](https://www.r-pkg.org/badges/version/openFDA)](https://CRAN.R-project.org/package=openFDA)
[![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)
[![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)
[![Codecov test coverage](https://codecov.io/gh/simpar1471/openFDA/graph/badge.svg)](https://app.codecov.io/gh/simpar1471/openFDA)
<!-- badges: end -->

Expand All @@ -28,17 +29,18 @@ Note that the data on openFDA has not been validated for clinical or production

## Installation

You can install the development version of openFDA from GitHub using either
[pak](https://pak.r-lib.org/) or [devtools](https://devtools.r-lib.org/):

```r
# install.packages("pak")
pak::pkg_install("simpar1471/openFDA")
# The easiest way to get openFDA is to install it from CRAN:
install.packages("openFDA")
```

### Dev version
Alternatively, you can install the development version of openFDA from GitHub using either
[pak](https://pak.r-lib.org/):

```r
# install.packages("devtools")
devtools::install_github("simpar1471/openFDA")
# install.packages("pak")
pak::pkg_install("simpar1471/openFDA")
```

## Using openFDA
Expand Down
37 changes: 20 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

<!-- badges: start -->

[![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)
[![Project Status: WIP – Initial development is in progress, but there
has not yet been a stable, usable release suitable for the
public.](https://www.repostatus.org/badges/latest/wip.svg)](https://www.repostatus.org/#wip)
[![CRAN
status](https://www.r-pkg.org/badges/version/openFDA)](https://CRAN.R-project.org/package=openFDA)
[![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)
[![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)
[![Codecov test
coverage](https://codecov.io/gh/simpar1471/openFDA/graph/badge.svg)](https://app.codecov.io/gh/simpar1471/openFDA)
<!-- badges: end -->
Expand All @@ -22,18 +22,19 @@ validated for clinical or production use.

## Installation

You can install the development version of openFDA from GitHub using
either [pak](https://pak.r-lib.org/) or
[devtools](https://devtools.r-lib.org/):

``` r
# install.packages("pak")
pak::pkg_install("simpar1471/openFDA")
# The easiest way to get openFDA is to install it from CRAN:
install.packages("openFDA")
```

### Dev version

Alternatively, you can install the development version of openFDA from
GitHub using either [pak](https://pak.r-lib.org/):

``` r
# install.packages("devtools")
devtools::install_github("simpar1471/openFDA")
# install.packages("pak")
pak::pkg_install("simpar1471/openFDA")
```

## Using openFDA
Expand Down Expand Up @@ -61,7 +62,7 @@ search
#> https://api.fda.gov/drug/drugsfda.json?api_key=[API_KEY]&search=openfda.generic_name:furosemide&limit=5
#> Status: 200 OK
#> Content-Type: application/json
#> Body: In memory (17286 bytes)
#> Body: In memory (26060 bytes)
```

The underlying response is JSON data - you can use
Expand All @@ -73,7 +74,7 @@ json <- httr2::resp_body_json(search)

json$results[[1]]$openfda$brand_name
#> [[1]]
#> [1] "FUROSEMIDE"
#> [1] "FUROSCIX"
json$results[[1]]$openfda$pharm_class_epc
#> [[1]]
#> [1] "Loop Diuretic [EPC]"
Expand All @@ -87,9 +88,11 @@ purrr::map_chr(
.x = json$results,
.f = \(result) purrr::pluck(result, "openfda", "manufacturer_name", 1)
)
#> [1] "Amneal Pharmaceuticals LLC" "Gland Pharma Limited"
#> [3] "Solco Healthcare LLC" "Lifestar Pharma LLC"
#> [5] "Ipca Laboratories Limited"
#> [1] "scPharmaceuticals Inc."
#> [2] "Graviti Pharmaceuticals Private Limited"
#> [3] "Hikma Pharmaceuticals USA Inc."
#> [4] "Civica, Inc."
#> [5] "Eugia US LLC"
```

## Other R packages for openFDA
Expand Down

0 comments on commit f3c76c7

Please sign in to comment.