Skip to content

Commit

Permalink
Closes #2427 general issue adopt data and data raw conventions (#2494)
Browse files Browse the repository at this point in the history
* attempt zero

* 2427_adopt_data_data_raw_conventions-FIrst

* 2427 ..DRAFT .. except for a few comments to be removed,  this is almost PR

* Issue 2427 first serious attempt for example_qs.rda, see comments

* 2427_ ran spelling, styler, lintr, but it dislikes use of source()

* 2427 removed data-raw/test.R and old_data/example_qs.rda.  This means no more testing.  The file data/example_qs.rda will be used, going forward.

* 2427 EXPERIMENT ... data-raw/example_qs.R ... commented out library calls

* EXPERIMENT 2  - remove unnecessary commnets;
style_pkg() - no errors, does check example_qs.R
lint() reports no errors.

* EXPERIMENT 3 - hys_law.Rmd missing close paraenthesis at end of FDA url.

* EXPERIMENT 4  (1) admiraldev is REQUIRED or vignette won't build  (2) added admiral per Hadley, but truly needed?

* 2427 Add URL: https://www.fda.gov/media/116737/download to .lycheeignore because github actions reports 404.  But the link is good.

* 2427 EXPERIMENT, remove fda from .lycheeignore; change title of fda link

* 2427 EXPERIMENT  restore fda link to .ycheeignore; it is essential

* 2427 ... add   to WORDLIST

* #2427  derive_single_dose should work.
added (temporarily(   backup_data/

* Issue #2427 Code for atoxgr*.rda move to data-raw/

* Remove unnecessary comment.

* EXPERIMENT:   Is newly created dataset data/admiral_adlb.rda identical to backup?   NO

* EXPERIMENT ... Generate data/admiral_adlb.rda using template, temporary .cache storage, inner_join to reduce number of rows.   NOT FINAL.

* Cleaned create_admiral_adlb.R  code.  Calls template, then script to generate admiral_adlb.rda
Finally, checks new and old admiral_adlb.rda are IDENTICAL.

* correct spelling; add short note to helper script (create_admiral_adlb.R)

* experiment:  2 files (create_admiral_*.R) to create admiral_adlb.rda, admiral_adsl.rda).

Show DIFFERCE between creating *.rda by template vs backup data.  (not in this PR)

Will not pass lint.

* add diffdf and key to track differences

* Ran styler::style_pkg()
Ran  devtools::lint()

To be changed to standard form:   CACHE_DIR, DATA_RAW ... once I am sure code is correct.

NO change to .RBuildignore (not sure if consensus)

* re-run roxygen

* Apply # nolint;  NOTE:  library(lintr) has many options.  For example, to nolint a block of code:  # nolint start and # nolint end   can be used; (done in this commit)
Also note, possible to turn off  SPECIFIC linters (also done in this commit for "object_name_linter")

* Apply # nolint;  NOTE:  library(lintr) has many options.  For example, to nolint a block of code:  # nolint start and # nolint end   can be used; (done in this commit)
Also note, possible to turn off  SPECIFIC linters (also done in this commit for "object_name_linter")

* manged to mangle git.  Do not think need file with purl.  (Delete it?    git reset back before I accidentally pt it into a push?)

* remove purl_adsl_vignette.R;  added by error

* chore: #2427 developer news

* chore: #2427 spelling

---------

Co-authored-by: Ben Straub <[email protected]>
  • Loading branch information
jimrothstein and bms63 authored Oct 3, 2024
1 parent dd42a67 commit 9cf826d
Show file tree
Hide file tree
Showing 24 changed files with 701 additions and 6 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,5 @@
^\.devcontainer$
^vignettes/articles$
^inst/cheatsheet$
^data-raw$
^doc$
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,5 @@ admiral*.tgz
._.DS_Store

.Rprofile
/doc/
/Meta/
1 change: 1 addition & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ https://raw.githubusercontent.com/pharmaverse/admiral/main/inst/cheatsheet/cheat
https://rsc.niaid.nih.gov/clinical-research-sites/daids-adverse-event-grading-tables
https://rsc.niaid.nih.gov/sites/default/files/daidsgradingcorrectedv21.pdf
https://www.fda.gov/media/116737/download

2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
<details>
<summary>Developer Notes</summary>

- Adopted `data-raw/data` R Package Convention (#2427)

</details>

# admiral 1.1.1
Expand Down
Binary file added data-backup/admiral_adlb.rda
Binary file not shown.
Binary file added data-backup/admiral_adsl.rda
Binary file not shown.
Binary file added data-raw/adlb_grading/adlb_grading_spec.xlsx
Binary file not shown.
22 changes: 22 additions & 0 deletions data-raw/adlb_grading/atoxgr_sources.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
atoxgr_criteria <- system.file("adlb_grading/adlb_grading_spec.xlsx", package = "admiral")
# Contrary to our usual convention the use of `::` here is explicit. This way we
# avoid having to list {readxl} in "Imports" and instead get away with just
# listing it in "Depends".

atoxgr_criteria_ctcv4 <- atoxgr_criteria %>%
readxl::read_excel(sheet = "NCICTCAEv4") %>%
dplyr::mutate(GRADE_CRITERIA_CODE = gsub("[\r\n]", " ", GRADE_CRITERIA_CODE))

usethis::use_data(atoxgr_criteria_ctcv4, overwrite = TRUE)

atoxgr_criteria_ctcv5 <- atoxgr_criteria %>%
readxl::read_excel(sheet = "NCICTCAEv5") %>%
dplyr::mutate(GRADE_CRITERIA_CODE = gsub("[\r\n]", " ", GRADE_CRITERIA_CODE))

use_data(atoxgr_criteria_ctcv5, overwrite = TRUE)

atoxgr_criteria_daids <- atoxgr_criteria %>%
readxl::read_excel(sheet = "DAIDS") %>%
dplyr::mutate(GRADE_CRITERIA_CODE = gsub("[\r\n]", " ", GRADE_CRITERIA_CODE))

use_data(atoxgr_criteria_daids, overwrite = TRUE)
Loading

0 comments on commit 9cf826d

Please sign in to comment.