pharmaverse / pharmaversesdtm

Test SDTM data for use within the pharmaverse family of packages
https://pharmaverse.github.io/pharmaversesdtm
Apache License 2.0
13 stars 2 forks source link

Closes #1: Update `admiraltemplate` to `admiraldata` and copy from admiral.test #21

Closed kaz462 closed 1 year ago

kaz462 commented 1 year ago

Thank you for your Pull Request! We have developed this task checklist from the Development Process Guide to help with the final steps of the process. Completing the below tasks helps to ensure our reviewers can maximize their time on your code as well as making sure the admiral codebase remains robust and consistent.

Please check off each taskbox as an acknowledgment that you completed the task or check off that it is not relevant to your Pull Request. This checklist is part of the Github Action workflows and the Pull Request will not be merged into the devel branch until you have checked off each task.

kaz462 commented 1 year ago

Following updates in this PR:

  1. Copied R/data.R, dev and data folders from admiral.test to admiraldata
    git clone https://github.com/pharmaverse/admiral.test.git --branch devel --single-branch ./admiral.test --depth 1
    cp -R ./admiral.test/data  ./admiraldata
    cp -R ./admiral.test/dev  ./admiraldata
    cp ./admiral.test/R/data.R  ./admiraldata/R
    rm -rf admiral.test
  2. Updated the following and removed some template files & tests folder
    1. Update/Remove the following files to use your extension name:
      • DESCRIPTION File - Name, Authors
      • admiraltemplate.Rproj
      • testthat.R
      • News.md
      • .Rbuildignore
      • .gitignore
      • .lycheeignore
      • _pkgdown.yml
  3. devtools::document() + resolve workflow issues
kaz462 commented 1 year ago

@kaz462 is it worth not copying the data in the {admiral.test} data folder and just regenerating it with the files that you copy over? Just to make sure that what you copied over genuinely makes the dataset that you expect?

I got some errors when I try to rerun the programs from admiral.test/dev. @manciniedoardo Should we merge this PR first, and create a separate issue for rerunning datasets (some programs need updates), so that we can work on other issues in parallel? - issue created

e.g., errors from dev/pp.R-

> data("pc")
Warning message:
In data("pc") : data set ‘pc’ not found
> 
> # Calculate subjects with all missing;
> blq_usubjid <- pc %>%
+   ungroup() %>%
+   group_by(STUDYID, DOMAIN, USUBJID) %>%
+   summarise(PPORRES = max(PCSTRESN, na.rm = TRUE))
> 
> # Remove from PC, subjects with all blq (placebos);
> remove_usubjid <- blq_usubjid %>% filter(PPORRES == 0)
> 
> pc1 <- anti_join(pc, remove_usubjid, by = c("STUDYID", "DOMAIN", "USUBJID"))
Error in `anti_join()`:
! Join columns in `y` must be present in the data.
✖ Problem with `STUDYID`, `DOMAIN`, and `USUBJID`.
Run `rlang::last_trace()` to see where the error occurred.
kaz462 commented 1 year ago

@pharmaverse/admiraldata If you are assigned to admiraldata issues, please wait until this PR is merged