-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
98c8d86
commit 1419bb0
Showing
191 changed files
with
2,141 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,4 +4,6 @@ | |
^_pkgdown\.yml$ | ||
^docs$ | ||
^pkgdown$ | ||
dev/* | ||
dev/* | ||
data-raw/* | ||
^\.github$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
*.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
|
||
name: R-CMD-check | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
R-CMD-check: | ||
runs-on: ${{ matrix.config.os }} | ||
|
||
name: ${{ matrix.config.os }} (${{ matrix.config.r }}) | ||
|
||
strategy: | ||
fail-fast: false | ||
matrix: | ||
config: | ||
- {os: macos-latest, r: 'release'} | ||
- {os: windows-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'devel', http-user-agent: 'release'} | ||
- {os: ubuntu-latest, r: 'release'} | ||
- {os: ubuntu-latest, r: 'oldrel-1'} | ||
|
||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
R_KEEP_PKG_SOURCE: yes | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-pandoc@v2 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
r-version: ${{ matrix.config.r }} | ||
http-user-agent: ${{ matrix.config.http-user-agent }} | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::rcmdcheck | ||
needs: check | ||
|
||
- uses: r-lib/actions/check-r-package@v2 | ||
with: | ||
upload-snapshots: true | ||
build_args: 'c("--no-manual","--compact-vignettes=gs+qpdf")' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples | ||
# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help | ||
on: | ||
push: | ||
branches: [main, master] | ||
pull_request: | ||
branches: [main, master] | ||
|
||
name: test-coverage | ||
|
||
permissions: read-all | ||
|
||
jobs: | ||
test-coverage: | ||
runs-on: ubuntu-latest | ||
env: | ||
GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- uses: r-lib/actions/setup-r@v2 | ||
with: | ||
use-public-rspm: true | ||
|
||
- uses: r-lib/actions/setup-r-dependencies@v2 | ||
with: | ||
extra-packages: any::covr, any::xml2 | ||
needs: coverage | ||
|
||
- name: Test coverage | ||
run: | | ||
cov <- covr::package_coverage( | ||
quiet = FALSE, | ||
clean = FALSE, | ||
install_path = file.path(normalizePath(Sys.getenv("RUNNER_TEMP"), winslash = "/"), "package") | ||
) | ||
covr::to_cobertura(cov) | ||
shell: Rscript {0} | ||
|
||
- uses: codecov/codecov-action@v4 | ||
with: | ||
fail_ci_if_error: ${{ github.event_name != 'pull_request' && true || false }} | ||
file: ./cobertura.xml | ||
plugin: noop | ||
disable_search: true | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
|
||
- name: Show testthat output | ||
if: always() | ||
run: | | ||
## -------------------------------------------------------------------- | ||
find '${{ runner.temp }}/package' -name 'testthat.Rout*' -exec cat '{}' \; || true | ||
shell: bash | ||
|
||
- name: Upload test results | ||
if: failure() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: coverage-test-failures | ||
path: ${{ runner.temp }}/package |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,38 @@ | ||
#' Placeholder data x | ||
# antibiotics who---- | ||
|
||
#' WHO antibiotics list | ||
#' | ||
#' This dataset contains one value, x | ||
#' This dataset contains information on antibiotics from WHO. More details to follow. | ||
#' | ||
#' @format | ||
#' \describe{ | ||
#' \item{x}{The placeholder data x} | ||
#' \item{Antibiotic}{Name of the antibiotic} | ||
#' \item{Class}{Antibiotic class} | ||
#' \item{ATC code}{ATC code} | ||
#' \item{Category}{Access, watch or reserve} | ||
#' \item{Listed on EML/EMLc 2023}{Whether listed} | ||
#' \item{color_code}{Color code according to category} | ||
#' } | ||
#' @examples | ||
#' print(x) | ||
"x" | ||
#' head(ab_who) | ||
"ab_who" | ||
|
||
|
||
# antibiotics ahus ---- | ||
#' AHUS antibiotics list | ||
#' | ||
#' This dataset contains information on antibiotics from AHUS. More details to follow. | ||
#' | ||
#' @format | ||
#' \describe{ | ||
#' \item{Antibiotic}{Name of the antibiotic} | ||
#' \item{Category}{Access, watch or reserve} | ||
#' \item{Norsk_AHUS}{The Norwegian name, in AHUS hospital system} | ||
#' \item{color_code}{Color code according to category} | ||
#' } | ||
#' @examples | ||
#' head(ab_ahus) | ||
"ab_ahus" | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
library(readxl) | ||
library(data.table) | ||
|
||
|
||
# antibiotics who ---- | ||
# this list also has data on the AHUS | ||
# list.files(system.file('extdata', package = 'ggehr')) | ||
# | ||
# fs::path_package('ggehr') | ||
# system.file("extdata", "ab_list_who.xlsx", | ||
# package = "ggehr") | ||
# dir(system.file("extdata", "ab_list_who.xlsx", | ||
# package = "ggehr")) | ||
# getwd() | ||
ablist <- readxl::read_xlsx('./inst/extdata/ab_list_who.xlsx') | ||
|
||
# ablist <- readxl::read_xlsx(system.file("extdata", "ab_list_who.xlsx", | ||
# package = "ggehr")) | ||
ablist <- setDT(ablist) | ||
head(ablist) | ||
colnames(ablist) | ||
|
||
# code colors | ||
# access: green | ||
# watch: yellow | ||
# reserve: red | ||
|
||
ablist[Category == 'Access', color_code := 'green'] | ||
ablist[Category == 'Watch', color_code := 'yellow'] | ||
ablist[Category == 'Reserve', color_code := 'red'] | ||
|
||
head(ablist) | ||
|
||
# for who, drop the one for ahus | ||
ab_who <- copy(ablist) | ||
ab_who[, Norsk_AHUS := NULL] | ||
|
||
# save | ||
save(ab_who, file = 'data/ab_who.rda', compress = 'xz') | ||
|
||
|
||
|
||
# ahus specific ---- | ||
# keep the ahus ones | ||
ab_ahus <- ablist[!is.na(Norsk_AHUS), .(Antibiotic, Category, Norsk_AHUS, color_code)] | ||
|
||
ab_ahus$Category |> table() | ||
# 21 access, 2 reserve, 16 watch | ||
|
||
|
||
ab_ahus[Category == 'Reserve'] | ||
# Aztreonam, Linezolid (very rare) | ||
ab_ahus[Category == 'Watch'] | ||
|
||
|
||
# save | ||
save(ab_ahus, file = 'data/ab_ahus.rda', compress = 'xz') | ||
|
||
|
||
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.