Retrieve and Compile Study Data from SQLite Database or .xpt
Files
Source: R/get_compile_data.R
get_compile_data.Rd
Retrieves, cleans, and compiles data for a specified STUDYID
from either a SQLite database or .xpt
files in a given folder.
Arguments
- studyid
Character. STUDYID number. Defaults to
NULL
. Required for SQLite databases (use_xpt_file = FALSE
). Must beNULL
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 toFALSE
.- use_xpt_file
Logical. Whether to retrieve study data from
.xpt
files instead of the SQLite database. Defaults toFALSE
.
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)
} # }