R/NMexpandDoses.R
NMexpandDoses.Rd
Replaces single row repeated dosing events by multiple lines, then reorders rows with respect to ID and TIME. If the row order is different, you have to reorder the output manually.
NMexpandDoses(
data,
col.time = "TIME",
col.id = "ID",
col.evid = "EVID",
track.expand = FALSE,
subset.dos,
quiet = FALSE,
as.fun
)
The data set to expand
The name of the column holding the time on which time since previous dose will be based. This is typically actual or nominal time since first dose.
The subject identifier. All new columns will be derived within unique values of this column.
The name of the event ID column. This must exist in data. Default is EVID.
Keep track of what rows were in data originally and which ones are added by NMexpandDoses by including a column called nmexpand? nmexpand will be TRUE if the row is "generated" by NMexpandDoses.
A string that will be evaluated as a custom expression to identify relevant events.
Suppress messages back to user (default is FALSE)
The default is to return data as a data.frame. Pass a function (say tibble::as_tibble) in as.fun to convert to something else. If data.tables are wanted, use as.fun="data.table". The default can be configured using NMdataConf.
A data set with at least as many rows as data. If doses are found to expand, these will be added.