Skip to content

Commit

Permalink
Changes per Issue #9 and Issue #10. I think the first paper (quinary …
Browse files Browse the repository at this point in the history
…word) is in much better shape now. Moving on to the second paper shortly.
  • Loading branch information
gabrielodom committed Sep 17, 2022
1 parent 177a811 commit 8bc4650
Show file tree
Hide file tree
Showing 8 changed files with 145 additions and 60 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ vignettes/*.pdf
*.RDA
*.Rda
!vignettes/*.rda
!data/outcomesCTN0094.rda
!data/egOpioidsCTN0094.rda


# csv data
*.csv
Expand Down
4 changes: 1 addition & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ License: GPL-3
Encoding: UTF-8
RoxygenNote: 7.2.1
Depends:
R (>= 3.1.0),
ctn0094data,
ctn0094DataExtra
R (>= 3.1.0)
Imports:
stringi,
stringr
Expand Down
25 changes: 25 additions & 0 deletions R/data_egOpioidsCTN0094.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#' @title Opioid Use by Study Day for Example CTN-0094 Participants
#'
#' @description This data set is a table with daily positive opioid use
#' indicator for 10 participants from the CTN-0094 harmonized data sets. This
#' subset is to be used as an example of timeline-style opioid use data.
#'
#' @details This data is created in the script
#' `inst/scripts/create_allDrugs_opioid_subset_20220916.R`. The "when" column
#' measures the number of days after signed consent for the participant that
#' the opioid-positive urine screen was collected.
#'
#' @docType data
#'
#' @usage data(egOpioidsCTN0094)
#'
#' @format A tibble with `r scales::comma(nrow(egOpioidsCTN0094))` rows and
#' `r ncol(egOpioidsCTN0094)` columns. These columns include
#' \describe{
#' \item{who}{Patient ID}
#' \item{what}{A factor indicating what substance(s) were present in the
#' urine on day `when`; trivially, all substances are "opioids" for this
#' example data.}
#' \item{when}{The number of days since signed study consent}
#' }
"egOpioidsCTN0094"
Binary file added data/egOpioidsCTN0094.rda
Binary file not shown.
Binary file added data/outcomesCTN0094.rda
Binary file not shown.
22 changes: 22 additions & 0 deletions inst/scripts/create_allDrugs_opioid_subset_20220916.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Excerpt of all_drugs for 10 example participants
# Gabriel Odom
# 2022-09-16

library(ctn0094data)
library(ctn0094DataExtra)
library(tidyverse)

interestingPeople_int <- c(
163L, 210L, 242L, 4L, 17L, 13L, 1103L, 33L, 233L, 2089L
)

egOpioidsCTN0094 <-
all_drugs %>%
filter(who %in% interestingPeople_int) %>%
filter(source %in% c("UDS", "UDSAB")) %>%
filter(what == "Opioid") %>%
select(-source) %>%
distinct() %>%
arrange(who, when)

usethis::use_data(egOpioidsCTN0094)
32 changes: 32 additions & 0 deletions man/egOpioidsCTN0094.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

119 changes: 62 additions & 57 deletions vignettes/CTNote_vignette_20220908.Rmd

Large diffs are not rendered by default.

0 comments on commit 8bc4650

Please sign in to comment.