generated from pharmaverse/admiraltemplate
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Closes #39 cleaned up script commenting, structure of scripts for con…
…sistency (#46) * # 39 cleaned up commenting and structure of scripts to make them more consistent * #39 chore: styler * Update data-raw/pc.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * Update data-raw/pp.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * Update data-raw/rs_onco.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * Update data-raw/tr_onco.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * Update data-raw/ts.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * Update data-raw/tu_onco.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * Update data-raw/ae.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * Update data-raw/dm.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * Update data-raw/ds.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * Update data-raw/tr_onco.R Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com> * #39 data rerun with new labels --------- Co-authored-by: Kangjie Zhang <47867131+kaz462@users.noreply.github.com>
- Loading branch information
1 parent
e763ab7
commit 2f6bc1b
Showing
47 changed files
with
356 additions
and
213 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 |
---|---|---|
@@ -1,14 +1,22 @@ | ||
# from CDISC pilot study ---- | ||
# Datasets: ae, suppae | ||
# Description: Standard AE, SUPPAE datasets from CDISC pilot study | ||
|
||
# Load libraries ----- | ||
library(dplyr) | ||
library(metatools) | ||
library(haven) | ||
library(admiral) | ||
|
||
# Create ae, suppae ---- | ||
raw_ae <- read_xpt("https://github.com/cdisc-org/sdtm-adam-pilot-project/blob/master/updated-pilot-submission-package/900172/m5/datasets/cdiscpilot01/tabulations/sdtm/ae.xpt?raw=true") # nolint | ||
raw_suppae <- read_xpt("https://github.com/cdisc-org/sdtm-adam-pilot-project/blob/master/updated-pilot-submission-package/900172/m5/datasets/cdiscpilot01/tabulations/sdtm/suppae.xpt?raw=true") # nolint | ||
ae <- convert_blanks_to_na(raw_ae) | ||
suppae <- convert_blanks_to_na(raw_suppae) | ||
|
||
# Save dataset ---- | ||
save(ae, file = "data/ae.rda", compress = "bzip2") | ||
# Label dataset ---- | ||
attr(ae, "label") <- "Adverse Events" | ||
attr(suppae, "label") <- "Supplemental Qualifiers for AE" | ||
|
||
# Save datasets ---- | ||
usethis::use_data(ae, overwrite = TRUE) | ||
usethis::use_data(suppae, overwrite = TRUE) |
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,7 +1,16 @@ | ||
# from CDISC pilot study ---- | ||
# Dataset: cm | ||
# Description: Standard CM dataset from CDISC pilot study | ||
|
||
# Load libraries ----- | ||
library(haven) | ||
library(admiral) | ||
|
||
# Create cm ---- | ||
raw_cm <- read_xpt("https://github.com/cdisc-org/sdtm-adam-pilot-project/blob/master/updated-pilot-submission-package/900172/m5/datasets/cdiscpilot01/tabulations/sdtm/cm.xpt?raw=true") # nolint | ||
cm <- convert_blanks_to_na(raw_cm) | ||
|
||
# Label dataset ---- | ||
attr(cm, "label") <- "Concomitant Medications" | ||
|
||
# Save dataset ---- | ||
usethis::use_data(cm, overwrite = TRUE) |
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,21 @@ | ||
# from CDISC pilot study ---- | ||
# Datasets: dm, suppdm | ||
# Description: Standard DM, SUPPDM datasets from CDISC pilot study | ||
|
||
# Load libraries ----- | ||
library(haven) | ||
library(admiral) | ||
|
||
# Create dm, suppdm ---- | ||
sdtm_path <- "https://github.com/cdisc-org/sdtm-adam-pilot-project/blob/master/updated-pilot-submission-package/900172/m5/datasets/cdiscpilot01/tabulations/sdtm/" # nolint | ||
raw_dm <- read_xpt(paste0(sdtm_path, "dm", ".xpt?raw=true")) | ||
raw_suppdm <- read_xpt(paste0(sdtm_path, "suppdm", ".xpt?raw=true")) | ||
dm <- convert_blanks_to_na(raw_dm) | ||
suppdm <- convert_blanks_to_na(raw_suppdm) | ||
|
||
# Label dataset ---- | ||
attr(dm, "label") <- "Demographics" | ||
attr(suppdm, "label") <- "Supplemental Qualifiers for DM" | ||
|
||
# Save datasets ---- | ||
usethis::use_data(dm, overwrite = TRUE) | ||
usethis::use_data(suppdm, overwrite = TRUE) |
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,7 +1,16 @@ | ||
# from CDISC pilot study ---- | ||
# Dataset: ex | ||
# Description: Standard EX dataset from CDISC pilot study | ||
|
||
# Load libraries ----- | ||
library(haven) | ||
library(admiral) | ||
|
||
# Create ex ---- | ||
raw_ex <- read_xpt("https://github.com/cdisc-org/sdtm-adam-pilot-project/blob/master/updated-pilot-submission-package/900172/m5/datasets/cdiscpilot01/tabulations/sdtm/ex.xpt?raw=true") # nolint | ||
ex <- convert_blanks_to_na(raw_ex) | ||
|
||
# Label dataset ---- | ||
attr(ex, "label") <- "Exposure" | ||
|
||
# Save dataset ---- | ||
usethis::use_data(ex, overwrite = TRUE) |
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
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
Oops, something went wrong.