extractObsConcTime_mult: Extract observed concentration-time data from multiple Excel...

View source: R/extractObsConcTime_mult.R

extractObsConcTime_multR Documentation

Extract observed concentration-time data from multiple Excel files

Description

Extract observed data from Excel files that follow the Simcyp Simulator template for converting concentration-time data into an XML file.

Usage

extractObsConcTime_mult(
  obs_data_files = NA,
  compound_name = NA,
  perpetrator_name = NA,
  returnDosingInfo = FALSE
)

Arguments

obs_data_files

a character vector of the names of the Excel files containing the observed concentration-time data, each in quotes, NA (default) to extract data from all possible observed data Excel files in that folder, or "recursive" to extract data from all possible observed data Excel files in the current folder and any subfolders as well. These are the files that are ready to be converted to XML files, not files that contain only the digitized time and concentration data and not the XML files themselves that you would include in a Simulator workspace for observed data.

compound_name

the name of the compound, e.g., "midazolam". If you have more than one compound that you want to specify – for example, the data include both the substrate and primary metabolite 1 – you can specify them with a named character vector like this: compound_name = c("substrate" = "midazolam", "primary metabolite 1" = "OH-midazolam"). All possible compound IDs permissible here: "substrate", "primary metabolite 1", "primary metabolite 2", "secondary metabolite", "inhibitor 1", "inhibitor 2", or "inhibitor 1 metabolite".

perpetrator_name

the name of the perpetrator, where applicable, e.g., "itraconazole". This will be listed in the column "Inhibitor" in the output.

returnDosingInfo

TRUE or FALSE (default) for whether to return a second data.frame with dosing and demographic information from the Excel file.

add_t0

TRUE or FALSE (default) for whether to add t0 points if they're missing. Sometimes, observed data do not include a measurement at t0 because, presumably, the concentration should always be 0 at that time. If you're using these data to calculate PK, though, you'll miss that initial part of the AUC if t0 is missing. If add_t0 is set to TRUE, this will add a concentration of 0 and time 0 for all of the individual concentration-time profiles.

Value

a data.frame with the following columns:

Individual

the individual ID

CompoundID

the compound ID listed in the observed file, e.g., "Sub Plasma", "Sub PM1 Plasma", "Sub (Inb) Plasma"

Tissue

the tissue

Dose_sub, Dose_inhib, and/or Dose_inhib2

the dose of the substrate and any perpetrators present

Time

time since dosing

Conc

concentration

Time_units

the units of measurement for the time column

Conc_units

the units of measurement for the concentration column

Period, Age, Weight_kg, Height_cm, Sex, SerumCreatinine_umolL, HSA_gL, Haematocrit, PhenotypeCYP2D6, SmokingStatus

the columns in the template for "Period" and "Covariates" but with R-friendly names. (Currently, no dosing information is pulled because the data format is different from what we need for other functions related to concentration-time data.)

Examples

extractObsConcTime(obs_data_file = "My observed data.xlsx")


shirewoman2/Consultancy documentation built on Feb. 18, 2025, 10 p.m.