This function formats a data file for pharmacokinetic analysis by converting specific concentration values to numeric and adjusting time based on dose number.

format_data(datafile)

Arguments

datafile

A data frame containing the raw data to be formatted.

Value

A data frame with formatted concentration and time values.

Details

The function performs the following steps:

  • Converts concentration values ('AVAL') that are 'BLQ', 'Negative', 'negative', or 'NEGATIVE' to 0.

  • Adjusts the time values ('TIME') based on the dose number ('DOSNO'). If 'DOSNO' is 1, 'TIME' is set to 'AFRLT'; otherwise, it is set to 'TIME'.

Examples

if (FALSE) { # \dontrun{
  # Example usage:
  formatted_data <- format_data(raw_data)
} # }