Learn R Programming

amp.dm (version 0.2.0)

expand_addl_ii: Expand rows in case ADDL and II variables are present

Description

This function expands ADDL and II records. This is done by placing each ADDL record on a separate line. This is convenient in case of individual dose calculations

Usage

expand_addl_ii(data, evid = NULL, del_iiaddl = TRUE)

Value

a data frame with expanded dose records

Arguments

data

data frame to perform the expansion on

evid

character identifying the event ID (EVID) within the data frame This is used to distinguish observations from dosing records, e.g. 0 for observations

del_iiaddl

logical identifying if the ADDL and II variables can be deleted from output

Author

Richard Hooijmaijers

Details

The function expects that certain variables are present in the data (at least ID, TIME, ADDL and II)

Examples

Run this code

dfrm <- data.frame(ID=c(1,1), TIME=c(0,12),II=c(12,0),ADDL=c(5,0),AMT=c(10,0),EVID=c(1,0))
expand_addl_ii(dfrm,evid="EVID")

Run the code above in your browser using DataLab