From 84998a18670b386485b66119ce6cc324190d22eb Mon Sep 17 00:00:00 2001 From: Ian Taylor Date: Fri, 10 Mar 2023 12:44:25 -0800 Subject: [PATCH] fix empty cell placeholders in parameter table - related to https://github.com/pfmc-assessments/sa4ss/discussions/87 - Develop shared functions for making tables #78 --- R/table_pars.R | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/R/table_pars.R b/R/table_pars.R index 5edc149..3f13df4 100644 --- a/R/table_pars.R +++ b/R/table_pars.R @@ -21,16 +21,17 @@ table_pars <- function(output, Value = sprintf("%8.3f", Value), Bounds = sprintf("(%8.3f, %8.3f)", Min, Max), Status = dplyr::case_when( - is.na(Status) ~ "-", - Status == "act" ~ "-", + is.na(Status) ~ "fixed", + Status == "act" ~ "dev", TRUE ~ Status ), - SD = ifelse(is.na(Parm_StDev), " - ", sprintf("%2.2f", Parm_StDev)), + SD = ifelse(is.na(Parm_StDev), "0", sprintf("%2.2f", Parm_StDev)), pv = sprintf("%2.3f", Prior), psd = sprintf("%2.3f", Pr_SD), Prior = dplyr::case_when( Pr_type == "Log_Norm" ~ paste0("lognormal(", sprintf("%2.3f", exp(Prior)), ", ", psd, ")"), - Pr_type == "No_prior" ~ "-", + Pr_type == "Normal" ~ paste0("normal(", sprintf("%2.3f", Prior), ", ", psd, ")"), + Pr_type == "No_prior" ~ "none", Pr_type == "Full_Beta" ~ paste0("beta(", pv, ", ", psd, ")"), Pr_type == "dev" ~ paste0("normal(0.00, ", sigmar, ")"), TRUE ~ Pr_type