Skip to contents

A fit object is a data frame with one row per species, containing columns for the fitted distribution parameters. Required columns are species and distribution. Optional columns power (default 0) and min_w_pred (default 0) are added if missing.

Usage

validate_fit(fit)

Arguments

fit

A data frame or list with the fitted distribution parameters

Value

The valid fit data frame with species as rownames

Details

For backwards compatibility, a named list with the same fields is also accepted and silently converted to a single-row data frame.

See also

Examples

# Validate a fit data frame produced by fit_log_ppmr()
fit <- fit_log_ppmr(barnes_data, "Albacore", distribution = "normal")
validate_fit(fit)
#>              mean       sd  species distribution power min_w_pred
#> Albacore 9.546003 1.146738 Albacore       normal     0          0

# A named list is also accepted (backwards compatibility)
fit_list <- list(species = "test", distribution = "normal",
                 mean = 5, sd = 2)
validate_fit(fit_list)
#>      species distribution mean sd power min_w_pred
#> test    test       normal    5  2     0          0