Skip to contents

checkMicroFormat checks that a given data frame meets certain criteria and returns either a modified version of that data frame or an "empty" micro evaluation frame with given dose data and column names. See the details section below for more information.

Usage

checkMicroFormat(data, doseCol = getEctdColName("Dose"), mustHaveDose = FALSE)

Arguments

data

(Required) A data frame to check for validity

doseCol

(Optional) The "Dose" variable name within the supplied data. "DOSE" by default

mustHaveDose

(Optional) Should the "doseCol" variable necessarily be present? Default FALSE

Value

A data frame as described above

Details

checkMicroFormat will perform a series of basic checks on data.

The checks for a valid structure are as follows: (1) data is a data frame (2) data has at least 1 row (3) if "mustHaveDose" is TRUE, data contains a "Dose" column (given by doseCol)

If any of these fail it will stop or return a NULL structure

See also

Author

Francisco Gochez

Examples



  checkMicroFormat(data = data.frame(DOSE = 1:4),
  doseCol = "DOSE",
  mustHaveDose = TRUE)
#>   DOSE
#> 1    1
#> 2    2
#> 3    3
#> 4    4