Skip to content

Commit

Permalink
version 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Knapp authored and cran-robot committed Oct 23, 2023
0 parents commit 2718054
Show file tree
Hide file tree
Showing 69 changed files with 4,370 additions and 0 deletions.
40 changes: 40 additions & 0 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
Package: sdtmval
Title: Validate SDTM Domains
Version: 0.4.1
Authors@R:
person("Stephen", "Knapp",
email = "stephen@knappconsultingllc.com",
role = c("aut", "cre", "cph"),
comment = c(ORCID = "0000-0002-5101-4555"))
Description: Provides a set of tools to assist statistical programmers
in validating Study Data Tabulation Model (SDTM) domain data sets.
Statistical programmers are required to validate that a SDTM data set domain
has been programmed correctly, per the SDTM Implementation Guide (SDTMIG) by
'CDISC' (<https://www.cdisc.org/standards/foundational/sdtmig>),
study specification, and study protocol using a process called double
programming. Double programming involves two different programmers
independently converting the raw electronic data cut (EDC) data into a SDTM
domain data table and comparing their results to ensure accurate
standardization of the data. One of these attempts is termed 'production'
and the other 'validation'. Generally, production runs are the official
programs for submittals and these are written in 'SAS'. Validation runs can
be programmed in another language, in this case 'R'.
License: MIT + file LICENSE
Encoding: UTF-8
RoxygenNote: 7.2.3
URL: https://github.com/skgithub14/sdtmval,
https://skgithub14.github.io/sdtmval/
BugReports: https://github.com/skgithub14/sdtmval/issues
Imports: dplyr, glue, haven, knitr, lubridate, magrittr, purrr, readxl,
rlang, stats, stringr, tidyr, tidyselect, utils
Suggests: rmarkdown, testthat (>= 3.0.0)
Config/testthat/edition: 3
Depends: R (>= 2.10)
LazyData: true
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2023-10-20 17:23:43 UTC; sknapp
Author: Stephen Knapp [aut, cre, cph] (<https://orcid.org/0000-0002-5101-4555>)
Maintainer: Stephen Knapp <stephen@knappconsultingllc.com>
Repository: CRAN
Date/Publication: 2023-10-23 16:10:02 UTC
2 changes: 2 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
YEAR: 2023
COPYRIGHT HOLDER: sdtmval authors
68 changes: 68 additions & 0 deletions MD5
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
bff2cd92ded6ac84d0eb248601a381b0 *DESCRIPTION
25f8bd5708228ec6132d42c9e2110941 *LICENSE
18cabfeeaa5b85ec3e349a26681ab2cf *NAMESPACE
676bf7d3345002b1f31f12e34f8c54f5 *NEWS.md
15578b9d0d21ddce171685727cc5184b *R/data.R
dc4c80fb8e324660c976a93f930b02d9 *R/dates.R
cb960c8f070c999e3ae0296edcb87230 *R/format.R
023b4f95d23e1169f5650250b5032af5 *R/methods.R
0a95f4329bae6aeba6c2afef04c933a1 *R/read.R
6afe314d5ca41b342ed99dc0628e895b *R/sdtmval-package.R
0200a0bcda2415759f5f4a91eac0b921 *R/spec.R
b56ff2b193ecba52f9ec7f3b10cca008 *R/utils-pipe.R
7c2679b2d0aed038b3d51d8fade05d41 *R/write.R
b2eb773a6197b20996cd3cafaaa6c38b *README.md
7ef42721572aecc364296a6a43d1c058 *build/vignette.rds
7bfbeff6214435a2bafa43bf804e99ae *data/dm.rda
fe06cc91b0d1871a37aefdfff1b3fa7e *data/edc_xx.rda
afd4d0fb02dfb7fa3eb4ba7ed296d483 *data/spec_XX.rda
c67f5741f8c7e24dc0490a04a9b9a278 *data/spec_codelists.rda
c59a5c3704fef8a8b8a2de928b78be2e *data/spec_datasets.rda
e10bd507f6eedd0ea4a1f5a1e8d2a471 *data/vd.rda
7746ea0747488f274062d0ea40356b65 *data/xx_no_meta_data.rda
d446d7883411b9a37f3c8bd4f0b1e1a0 *inst/doc/Dates.R
f8a6e9a0e39806abfd2aea95167f4a30 *inst/doc/Dates.Rmd
5736db35acf6c5d68ef01a9f59634f29 *inst/doc/Dates.html
529d422f90ab8a91bbdc4969fe09a81c *inst/extdata/dm.sas7bdat
ef4fe3fedb30e527aaede69d0026fdfe *inst/extdata/spec.xlsx
32da5295db2d5d6bd259b83400867636 *inst/extdata/test_notebook.Rmd
b7203fa1d893a187bfa51883217aa934 *inst/extdata/vd.csv
af77b626caeb3dbeb4aa603baeaa2dc3 *inst/extdata/xx.csv
6ed00af5cbda4465df215d313e63f49a *man/assign_SEQ.Rd
aacf9cbf65e7a05e74cd245b60e127ac *man/assign_meta_data.Rd
3c30223c4ad7149fbbbf62bde0e9423b *man/calc_DY.Rd
ebc52c04cf2f692c930422bbf78ad77d *man/convert_to_script.Rd
0caf74485ec5332bacae3a73055cf6b0 *man/create_BLFL.Rd
5fdc63fe4865a65eab27f3c9ff99fd7c *man/create_EPOCH.Rd
02c7dfde46c0c2d046d343d8abcfc689 *man/create_STAT.Rd
e6e79cd4b31466b7aad4819e19a66dee *man/dm.Rd
84a7e40c86d7a0dd5b2b947162ebfdaa *man/edc_xx.Rd
a82f96656c944cd2554e3e8572e2309a *man/figures/logo.png
8af353d5999248109e5b6ae88674c3b2 *man/format_chars_and_dates.Rd
b6274ba402017936a1ef538ba840ea51 *man/get_codelist.Rd
aa9435cf961bd1a159feb3446b03c8ad *man/get_data_spec.Rd
ba1bd9cb01badfd2bba8a3d1b24ed406 *man/get_key_vars.Rd
5a91d94675a0280be060df3b9d232438 *man/impute_pdates.Rd
8f4aad003a999fae004ba9361f9a99d6 *man/pipe.Rd
c6db56bb93afc5cccdcba51e9e0150ae *man/read_edc_tbls.Rd
479b8ac8be1bd25cc01ca46956c181e7 *man/read_sdtm_tbls.Rd
c600a8bfdafd28f44182bc44f62b9c69 *man/reshape_adates.Rd
d3ef7b99bf4fc358a4039d32b358062b *man/reshape_pdates.Rd
6fe29286bf7f253663d203553e3597af *man/sdtmval-package.Rd
238b8540390ca39e1562c303475c76f5 *man/spec_XX.Rd
791a81011fb7720d17097c561069a387 *man/spec_codelists.Rd
b8a152e80e582ecca5d84ca3e6f6f675 *man/spec_datasets.Rd
041e6655ce2251ca66c7d7d49d8b9746 *man/trim_and_make_blanks_NA.Rd
41ff85f4b08648c10811290375353ac0 *man/trim_dates.Rd
9075ea53be840a39145bb8f8c74be40e *man/vd.Rd
cc7dbe2d4e70cbe2d400f0a5eef7685d *man/write_sessionInfo.Rd
f06dc052400424dc50587b09c80eda22 *man/write_tbl_to_xpt.Rd
c99e0ef6ef102a53d341fbd0824b401c *man/xx_no_meta_data.Rd
662aed3a717217013e736df01cd503a1 *tests/testthat.R
05e464b7feaa03be190038fd13e819d4 *tests/testthat/test-dates.R
f40d403759823102d8063176e66f69c7 *tests/testthat/test-format.R
096de6ff26022efd25d8ea960d81ab9f *tests/testthat/test-methods.R
040866e90c3ceecdfd98ff7e3ca363a1 *tests/testthat/test-read.R
4417d5bdd6801f7dbeb637614e4a105c *tests/testthat/test-spec.R
0f31df6c98f1a41f93027035d2b4b850 *tests/testthat/test-write.R
f8a6e9a0e39806abfd2aea95167f4a30 *vignettes/Dates.Rmd
28 changes: 28 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Generated by roxygen2: do not edit by hand

export("%>%")
export(assign_SEQ)
export(assign_meta_data)
export(calc_DY)
export(convert_to_script)
export(create_BLFL)
export(create_EPOCH)
export(create_STAT)
export(format_chars_and_dates)
export(get_codelist)
export(get_data_spec)
export(get_key_vars)
export(impute_pdates)
export(read_edc_tbls)
export(read_sdtm_tbls)
export(reshape_adates)
export(reshape_pdates)
export(trim_and_make_blanks_NA)
export(trim_dates)
export(write_sessionInfo)
export(write_tbl_to_xpt)
importFrom(magrittr,"%>%")
importFrom(rlang,":=")
importFrom(stats,setNames)
importFrom(utils,View)
importFrom(utils,read.csv)
67 changes: 67 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
# sdtmval 0.4.1

## Major changes

* None

## Minor changes

* Updated package description to include SDTM Implementation Guide author (CDSIC) and link

* Minor updates to convert_to_script() function documentation

## Bug fixes

* None

# sdtmval 0.4.0

## Major changes

* removed compare family of functions

## Minor changes

* added example for `create_STAT()` function

* prepared documentation for CRAN submission

# sdtmval 0.3.0

## Major changes

* added `create_STAT()` function

## Minor changes

* None

# sdtmval 0.2.1

## Major changes

* Changed argument order for `write_tbl_to_xpt()`, `convert_to_script()`, and `write_sessionInfo()` and set default for the `dir` argument to these functions as `NULL`

## Minor changes

* Improved `write_tbl_to_xpt()`, `convert_to_script()`, and `write_sessionInfo()` with input checking. Also added unit tests and improved the documentation and examples for these functions.

* `write_tbl_to_xpt()` now lets users set a data set name/label different from `filename`

# sdtmval 0.2.0

## Major changes

* Added functions for comparing QC to production SDTM domain data sets (`compare_qc_to_prod()`, `inspect_diffs()`, `summary_diffs()`)

* Added `convert_to_script()` for converting exploratory .Rmd to production .R scripts

* Added `write_sessionInfo()` for logging R session state after a script is run

## Minor changes

* Improved function documentation, {pkgdown} site, and README example

# sdtmval 0.1.0

* Initial release.
139 changes: 139 additions & 0 deletions R/data.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
#' Example EDC data for form/table 'XX'
#'
#' This is an example data set to simulate raw EDC data from the fake form/table
#' 'XX'.
#'
#' @format ## 'edc_xx'
#' A data frame with 8 rows and 6 columns:
#' \describe{
#' \item{STUDYID}{Study identifier}
#' \item{USUBJID}{Subject identifier}
#' \item{VISIT}{Visit name}
#' \item{XXTESTCD}{Test name, coded}
#' \item{XXORRES}{Test result}
#' }
"edc_xx"


#' Example SDTM domain table XX without meta data
#'
#' This data set is used to test the [assign_meta_data()] function and contains
#' a fake SDTM domain XX but without label or lengths assigned to the column
#' attributes.
#'
#' @format ## 'xx_no_meta_data'
#' A data frame with 10 rows and 11 columns:
#' \describe{
#' \item{STUDYID}{Study identifier}
#' \item{USUBJID}{Subject identifier}
#' \item{XXSEQ}{Sequence number}
#' \item{XXTESTCD}{Coded test name}
#' \item{XXTEST}{Test name}
#' \item{XXORRES}{Measurement in original units}
#' \item{XXBLFL}{Baseline flag}
#' \item{VISIT}{Visit name}
#' \item{EPOCH}{EPOCH}
#' \item{XXDTC}{Measurement date}
#' \item{XXDY}{Measurement day of study}
#' }
"xx_no_meta_data"


#' Example EDC data for form/table 'VD'
#'
#' This is an example data set to simulate raw EDC data from the 'VD' form/table
#' which contains visit date information by subject.
#'
#' @format ## 'vd'
#' A data frame with 6 rows and 3 columns:
#' \describe{
#' \item{USUBJID}{Subject identifier}
#' \item{VISIT}{Visit name}
#' \item{VISITDTC}{Visit date}
#' }
"vd"


#' Example SDTM Domain 'DM'
#'
#' This is an example data set to simulate a SDTM production domain 'DM' which
#' contains study start and end date information by subject. This can be used to
#' test [create_BLFL()], [create_EPOCH()], and [calc_DY()].
#'
#' @format ## 'dm'
#' A data frame with 2 rows and 4 columns:
#' \describe{
#' \item{USUBJID}{Subject identifier}
#' \item{RFSTDTC}{Study start date}
#' \item{RFXSTDTC}{First exposure date}
#' \item{RFXENDTC}{Last exposure date}
#' }
"dm"


#' Example 'Datasets' tab from a SDTM specification .xlsx file
#'
#' This table simulates an excerpt from a SDTM specification .xlsx file for the
#' 'Datasets' tab which provides the key variables for the fake domain XX. This
#' data set can be used to test the [get_key_vars()] function.
#'
#' @format ## 'spec_datasets'
#' A data frame with 1 row and 4 columns:
#' \describe{
#' \item{Dataset}{The domain}
#' \item{Description}{The domain description}
#' \item{Structure}{Defines what qualifies as a unique record}
#' \item{Key Variables}{The domain's key variables}
#' }
"spec_datasets"


#' Example domain specific tab from a SDTM specification .xlsx file
#'
#' This table simulates an excerpt from a SDTM specification .xlsx file for the
#' fake domain tab XX which provides the labels, data types, and lengths by
#' variable. This data set can be used to test the [get_data_spec()]
#' and [assign_meta_data()] functions.
#'
#' @format ## 'spec_XX'
#' A data frame with 12 rows and 5 columns:
#' \describe{
#' \item{Order}{The order of the varibles in the data set}
#' \item{Dataset}{The domain abbreviation}
#' \item{Varible}{The domain's variables}
#' \item{Label}{Variable labels}
#' \item{Data Type}{Variable data types}
#' \item{Length}{The maximum allowed length of an entry}
#' }
"spec_XX"


#' Example 'Codelists' tab from a SDTM specification .xlsx file
#'
#' This table simulates an excerpt from a SDTM specification .xlsx file for the
#' 'Codelists' tab which provides coded and decoded values from `XXTESTCD` and
#' `XXTEST` variables, respectively. This data set can be used to test the
#' [get_codelist()] function.
#'
#' @format ## 'spec_codelists'
#' A data frame with 3 rows and 3 columns:
#' \describe{
#' \item{ID}{The variable identifier/name}
#' \item{Term}{The coded term}
#' \item{Decoded Value}{The corresponding decoded value for the coded term}
#' }
"spec_codelists"














0 comments on commit 2718054

Please sign in to comment.