Skip to content
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
^vignettes/adxx\.Rmd$
^vignettes/pharmaversesdtm\.Rmd$
^data-raw$
^inst/extdata/.*\.csv$
^CRAN-SUBMISSION$
^cran-comments\.md$
^.devcontainer$
Expand Down
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: pharmaversesdtm
Title: SDTM Test Data for the 'Pharmaverse' Family of Packages
Version: 1.4.0
Version: 1.4.0.9000
Authors@R: c(
person("Lina", "Patil", , "lina.patil@cytel.com", role = c("aut", "cre")),
person("Stefan", "Bundfuss", role = "aut",
Expand Down
6 changes: 6 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# pharmaversesdtm (development version)

## Documentation

- Included CSV versions of all SDTM data under `extdata/sdtm-csv/` for ease of use of non R programmers. (#221)
Comment thread
Lina2689 marked this conversation as resolved.
Outdated

# pharmaversesdtm 1.4.0

## New Features
Expand Down
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# pharmaversesdtm <img src="man/figures/logo.png" align="right" width="200" style="margin-left:50px;" alt="pharmaverse sdtm hex"/>

> <sup>Interactive data exploration: <a href="https://pharmaverse.github.io/pharmaversesdtm/articles/preview-sdtm.html">Preview SDTM vignette</a></sup>
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should this be part of this PR? @Lina2689

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch, that is my bad I'll remove it later


<!-- badges: start -->

[![pharmaverse sdtm Badge](http://pharmaverse.org/shields/pharmaversesdtm.svg)](https://pharmaverse.org)
Expand All @@ -11,7 +13,7 @@ Test data (SDTM) for the pharmaverse family of packages

- [Purpose](#purpose)
- [Installation](#installation)
- [Data Sources](#data-sources)
- [Data](#data)
- [Naming Conventions](#naming)
- [How To Update](#how-to-update)

Expand All @@ -31,10 +33,17 @@ if (!requireNamespace("remotes", quietly = TRUE)) {
remotes::install_github("pharmaverse/pharmaversesdtm", ref = "main") # This command installs the latest development version directly from GitHub.
```

## Data Sources {#data-sources}

## Data {#data}

### Data Sources

Some test datasets have been sourced from the [CDISC pilot project](https://github.com/cdisc-org/sdtm-adam-pilot-project), while other datasets have been constructed ad-hoc by the {admiral} team. Please check the [Reference page](https://pharmaverse.github.io/pharmaversesdtm/reference/index.html) for detailed information regarding the source of specific datasets.

### Data Formats

Each dataset is provided in both RDA and CSV formats. The `.rda` files are used within the R package and saved in the repository [here](data/). The `.csv` files are saved [here](inst/extdata/).
Comment thread
Gero1999 marked this conversation as resolved.
Outdated

## Naming Conventions {#naming}

- Datasets that are TA-agnostic: same as SDTM domain name (e.g., `dm`, `rs`).
Expand Down Expand Up @@ -78,7 +87,7 @@ This metadata drives the automated documentation process, and the file is read b

### Adding New SDTM Datasets

- Create a program in the `data-raw/` folder, named `<name>.R`, where `<name>` should follow the [naming convention](#naming), to generate the test data and output `<name>.rda` to the `data/` folder.
- Create a program in the `data-raw/` folder, named `<name>.R`, where `<name>` should follow the [naming convention](#naming), to generate the test data and output `<name>.rda` to the `data/` folder, as well as `<name>.csv` to the `inst/extdata` folder.
Comment thread
Gero1999 marked this conversation as resolved.
Outdated
- Use CDISC pilot data such as `dm` as input in this program in order to create realistic synthetic data that remains consistent with other domains (not mandatory).
- Note that **no personal data should be used** as part of this package, even if anonymized.
- Run the program.
Expand All @@ -97,7 +106,7 @@ This metadata drives the automated documentation process, and the file is read b
- Modifying the dataset purpose or structure.
- Updating the dataset therapeutic area.
- Removing a dataset (delete its entry from the JSON entirely).
- Run the program, and output updated `<name>.rda` to the `data/` folder.
- Run the program, and output updated `<name>.rda` to the `data/` folder, as well as `<name>.csv` to the `inst/extdata` folder.
Comment thread
Gero1999 marked this conversation as resolved.
Outdated
- Run `data-raw/create_sdtms_data.R` in order to update `NAMESPACE` and update the `.Rd` files in `man/`.
- Add your GitHub handle to `.github/CODEOWNERS`.
- Update `NEWS.md`.
Expand Down
5 changes: 4 additions & 1 deletion data-raw/create_sdtms_data.R
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,9 @@ for (dataset_name in datasets) {
dataset <- get(dataset_name)
metadata <- specs[specs$name == dataset_name, ]

# For each dataset, save a CSV version in inst/extdata/
write.csv(dataset, file = file.path("inst/extdata/", paste0(dataset_name, ".csv")), row.names = FALSE)

# Add Test Codes and Test Names details in a table
# Identify column names ending in TEST and TESTCD
test_col <- names(dataset)[str_detect(string = names(dataset), pattern = "TEST$")]
Expand Down Expand Up @@ -201,7 +204,7 @@ for (dataset_name in datasets) {
# Add Therapeutic area keyword to the dataset name
dataset_keyword <- get_dataset_keyword(dataset_name, specs)
}

# Write the R documentation
write_doc(dataset, dataset_name, dataset_label, dataset_description, dataset_author, dataset_source, dataset_testnames, dataset_keyword)
}

Expand Down
Loading