prepareDoses: Prepare the Dose Data Set

Description Usage Arguments Details Value Author(s) Examples

View source: R/prepareDoses.R

Description

Create a dose data set with conforming data, and remove invalid records.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
prepareDoses(
  doseData,
  drugLevelData,
  drugLevelID = "id",
  drugLevelTimeVar = "date.time",
  drugLevelVar = "fent.level",
  idVar = "id",
  dateVar = "date.dose",
  infusionDoseTimeVar = NULL,
  infusionDoseVar = NULL,
  bolusDoseTimeVar = NULL,
  bolusDoseVar = NULL,
  otherDoseTimeVar = NULL,
  otherDoseVar = NULL,
  otherVars = NULL,
  lookForward = 7
)

Arguments

doseData

data.frame; data set with dose information

drugLevelData

data.frame; data set with drug level data

drugLevelID

character string; name of ID variable, defaults to id

drugLevelTimeVar

character string; name of date-time variable, defaults to date.time

drugLevelVar

character string; name of drug level variable, defaults to fent.level

idVar

character string; name of ID variable, defaults to id

dateVar

character string; name of date variable, defaults to date.dose

infusionDoseTimeVar

character string; name of infusion dose time variable

infusionDoseVar

character string; name of infusion dose variable

bolusDoseTimeVar

character string; name of bolus dose time variable

bolusDoseVar

character string; name of bolus dose variable

otherDoseTimeVar

character string; name of additional dose time variable

otherDoseVar

character string; name of additional dose variable

otherVars

character string; name of other variables within data set

lookForward

integer; initializes the time frame window with the number of days prior to the first drug level data; defaults to 7

Details

Wrapper function for conformDoses and trimDoses.

Value

data.frame, containing dose data

Author(s)

Cole Beck

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
options(pkdata.tz='America/Chicago')
dose.file <- read.csv(system.file('extdata', 'dosage.csv', package = 'pkdata'),
                      stringsAsFactors = FALSE)
drug.level.file <- read.csv(system.file('extdata', 'druglevel.csv', package = 'pkdata'),
                            stringsAsFactors = FALSE)
prepped <- prepareDoses(dose.file, drug.level.file,
     infusionDoseTimeVar='inf.time', infusionDoseVar='inf.dose',
     bolusDoseTimeVar='bol.time', bolusDoseVar='bol.dose',
     otherDoseTimeVar='patch.time', otherDoseVar='patch.dose',
     otherVars=c('gender','weight'))

couthcommander/pkdata documentation built on Sept. 11, 2021, 10:22 p.m.