Learn R Programming

admiral.test

admiral.test v0.7.0 will be the final version. At the end of 2023, the package will be archived in favor of pharmaversesdtm.

Test data for the {admiral} package taken from the CDISC pilot project and renamed with admiral_ prefix for clarity. As this mostly contains safety data only, we extend this as needed by adding further test data required such as for PK and TA-specific efficacy analyses. See the "How To Update" section below for more details.

Installation

The package is available from CRAN and can be installed by running install.packages("admiral.test").

To install the latest development version of the package directly from GitHub use the following code:

if (!requireNamespace("remotes", quietly = TRUE)) {
  install.packages("remotes")
}

remotes::install_github("pharmaverse/admiral.test", ref = "devel")

How To Update

Firstly, make a GitHub issue in this repo with the planned updates and tag @pharmaverse/admiral so that one of the development core team can sanity check the request. Then there are two main ways to extend the test data, either by adding new datasets or extending existing datasets with new records/variables. Whichever method you choose, it is worth noting the following:

  • Programs that generate test data are stored in the dev/ folder.
  • Each of these programs is written as a standalone R script: if any packages need to be loaded for a given program, then call library() at the start of the program (but please do not call library(admiral.test)).
  • Most of the packages that you are likely to need will already be specified in the renv.lock file, so they will already be installed if you have been keeping in sync--you can check this by entering renv::status() in the Console. However, you may also wish to install {metatools} and {ggplot2}, which are currently not specified in the renv.lock file. If you feel that you need to install any other packages in addition to those just mentioned, then please tag @pharmaverse/admiral to discuss with the development core team.
  • When you have created a program in the dev/ folder, you need to run it as a standalone R script, in order to generate a test dataset that will become part of the {admiral.test} package, but you do not need to build the package.
  • Following best practice, each dataset is stored as a .rda file whose name is consistent with the name of the dataset: for example, the dataset dm should be renamed to raw_dm before saving it as raw_dm.rda; if you save dm as raw_dm.rda and subsequently load the .rda file, then dm (not raw_dm) will be loaded into the global environment.
  • The programs in dev/ are stored within the {admiral.test} GitHub repository, but they are not part of the {admiral.test} package--the dev/ folder is specified in .Rbuildignore.
  • When you run a program that is in the dev/ folder, you generate a dataset that is written to the data/ folder, which will become part of the {admiral.test} package.
  • The names of test datasets are specified in R/data.R, for the purpose of generating documentation in the man/ folder.

Adding New SDTM Datasets

  • Create a program in the dev/ folder, named <name>.R, where <name> is the SDTM domain name, (e.g. rs.R), to generate the test data and output admiral_<name>.rda to the data/ folder. Use CDISC pilot data such as admiral_dm as input in this program in order to create realistic synthetic data that remains consistent with other domains. Note that no personal data should be used as part of this package, even if anonymized.
  • Run the program.
  • Reflect this update, by specifying admiral_<name> in R/data.R.
  • Run devtools::document() in order to update NAMESPACE and update the .Rd files in man/.

Updating Existing SDTM Datasets

  • Rename the source dataset as raw_<name>, where <name> is the SDTM domain name (e.g. rename ds to raw_ds), and then save it to the data/ folder as raw_<name>.rda (e.g. save(raw_ds, file = "data/raw_ds.rda")).
  • Create a program in the dev/ folder, named update_<name>.R, to load raw_<name>.rda, make the updates, and output admiral_<name>.rda to the data/ folder.
  • Run the program.
  • Reflect this update, by specifying both raw_<name> and admiral_<name> in R/data.R.
  • Run devtools::document() in order to update NAMESPACE and update the .Rd files in man/.

Copy Link

Version

Install

install.packages('admiral.test')

Monthly Downloads

399

Version

0.7.0

License

Apache License (>= 2.0)

Maintainer

Ben Straub

Last Published

September 10th, 2023

Functions in admiral.test (0.7.0)

admiral_qs

Questionnaire Dataset
raw_suppds

Supplemental Disposition Dataset-raw
raw_ds

Disposition Dataset-raw
raw_lb

Laboratory Measurements Dataset
admiral_rs

Disease Response Dataset
admiral_sv

Subject Visits Dataset
admiral_supptr

Supplemental Tumor Results Dataset
admiral_sdg_db

SDG Dataset
raw_mh

Medical History Dataset-raw
admiral_sc

Subject Characteristic Dataset
get_terms

An example function as expected by the `get_terms_fun` parameter of `admiral::create_query_data()`
raw_qs

Questionnaire Dataset
admiral_ts

Trial Design Dataset
raw_ae

Adverse Events Dataset-raw
admiral_oe

Ophthalmic Examinations Dataset
admiral_smq_db

SMQ Dataset
admiral_dm

Demography Dataset
admiral_cm

Concomitant Medication Dataset
admiral_lb

Laboratory Measurements Dataset
admiral_ex

Exposure Dataset
admiral_ds

Disposition Dataset-updated
admiral_suppae

Supplemental Adverse Events Dataset
admiral_mh

Medical History Dataset-updated
admiral_ae

Adverse Events Dataset-updated
admiral_eg

Electrocardiogram Dataset
admiral_tr

Tumor Results Dataset
admiral.test-package

admiral.test: Test Data for the 'admiral' Package
admiral_suppdm

Supplemental Demography Dataset
admiral_suppds

Supplemental Disposition Dataset-updated
admiral_pc

Pharmacokinetics Concentrations Dataset
admiral_pp

Pharmacokinetic Parameters Dataset
admiral_tu

Tumor Identification Dataset
admiral_vs

Vital Signs Dataset