Skip to contents

Retrieves, cleans, and compiles data for a specified STUDYID from either a SQLite database or .xpt files in a given folder.

Usage

get_compile_data(
  studyid = NULL,
  path_db,
  fake_study = FALSE,
  use_xpt_file = FALSE
)

Arguments

studyid

Character. STUDYID number. Defaults to NULL. Required for SQLite databases (use_xpt_file = FALSE). Must be NULL for .xpt files (use_xpt_file = TRUE).

path_db

Character. Path to the SQLite database file or a folder containing .xpt files. Mandatory.

fake_study

Logical. Whether the study data is generated by the SENDsanitizer package. Defaults to FALSE.

use_xpt_file

Logical. Whether to retrieve study data from .xpt files instead of the SQLite database. Defaults to FALSE.

Value

A data frame containing the following columns:

  • STUDYID - Study identifier.

  • USUBJID - Unique subject identifier.

  • Species - Species of the test subject.

  • SEX - Sex of the test subject.

  • ARMCD - Code representing specific Trial Arm (e.g., Low Dose, Mid Dose).

  • SETCD - Code representing distinct "groups" or "trial sets".

Examples

if (FALSE) { # \dontrun{
# Retrieve data for a specific study ID from the database
get_compile_data(studyid = '1234123',
                 path_db = 'path/to/database.db',
                 fake_study = FALSE,
                 use_xpt_file = FALSE)

# Retrieve data from all XPT files in a folder
get_compile_data(studyid = NULL,
                 path_db = 'path/to/folder',
                 fake_study = FALSE,
                 use_xpt_file = TRUE)
} # }