Creates an "empty" (i.e. filled in with NA values) micro evaluation data frame that has its column names and dose column name given by arguments.
Usage
createEmptyMicro(
doses,
doseCol = "DOSE",
microColumnNames = c(doseName = doseCol, "MEAN", "SE", "LOWER", "UPPER", "N")
)
Arguments
- doses
(Required) A mixed numeric or character vector of dose data that will be the dose column of the data frame. It must not contain any duplicate entries.
- doseCol
(Optional) A string indicating the name of the column which will hold the " doses" vector. "DOSE" by default
- microColumnNames
(Optional) A character vector containing the names of the columns of the micro evaluation data frame. By default, variables "MEAN", "SE", "LOWER", "UPPER" and "N" are created in addition to the dose variable
Details
createEmptyMicro will return a data frame whose column names are given by
microColumnNames
. The first column of the resulting data frame will
contain the doses
vector by default. The data frame will have as
many rows as there are entries in doses
. All of the frame's other
entries will be NA. This function will generate an error if "doses" contains
duplicate entries or if the dose column name specified by doseCol
doeses not occur in microColumnNames
.
Note
Future versions of MSToolkit will relax the format of the MicroEvaluation dataset allowing a more free structure for this dataset.
Examples
createEmptyMicro(doses = c(10, 20 ,30, 40))
#> DOSE MEAN SE LOWER UPPER N
#> 1 10 NA NA NA NA NA
#> 2 20 NA NA NA NA NA
#> 3 30 NA NA NA NA NA
#> 4 40 NA NA NA NA NA
createEmptyMicro(doses = c(5, 25), doseCol = "D", microColumnNames = c("D", "MEAN", "SE",
"LOWER"))
#> D MEAN SE LOWER
#> 1 5 NA NA NA
#> 2 25 NA NA NA