Skip to contents

Extracts the OFV reported on the #OBJV: line of a NONMEM .lst file. For failed or early-terminated runs where #OBJV: is absent, the function falls back to the workflow footer (OFV = ...) and returns NA with a warning if neither is found.

Usage

fetch_ofv(lst, digits = NA)

Arguments

lst

An object of class "lst" from read_lst_file().

digits

Integer or NA. Rounding for the OFV. Default NA.

Value

A single numeric value (the OFV), or NA_real_ if not found.

Examples

path <- system.file("testdata", "full_cov.lst", package = "lstparsR")
lst  <- read_lst_file(path)
fetch_ofv(lst)
#> [1] 8986.318