Skip to content

Commit

Permalink
feat: print signif digits in param table #78 #81
Browse files Browse the repository at this point in the history
  • Loading branch information
iantaylor-NOAA committed Mar 10, 2023
1 parent a98313d commit b974fcf
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions R/table_pars.R
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,15 @@ table_pars <- function(output,
dplyr::slice(rows) %>%
dplyr::select(Label, Value, Phase, Min, Max, Pr_type, Prior, Parm_StDev, Pr_SD, Status) %>%
dplyr::mutate(
Value = sprintf("%8.3f", Value),
Bounds = sprintf("(%8.3f, %8.3f)", Min, Max) %>% stringr::str_replace("\\(\\s+", "("),
Value = signif_string(Value, 3),
Bounds = paste0("(", signif_string(Min, 2), ", ", signif_string(Max, 2), ")"),
Status = dplyr::case_when(
is.na(Status) ~ "fixed",
Status == "act" ~ "dev",
Status == "OK" ~ "ok",
TRUE ~ Status
),
SD = ifelse(is.na(Parm_StDev), "0", sprintf("%2.2f", Parm_StDev)),
SD = ifelse(is.na(Parm_StDev), "0", signif_string(Parm_StDev, 3)),
pv = sprintf("%2.3f", Prior),
psd = sprintf("%2.3f", Pr_SD),
Prior = dplyr::case_when(
Expand Down

0 comments on commit b974fcf

Please sign in to comment.