Skip to content

Commit 5bae34b

Browse files
committed
add table to Solver tab with params from Advanced tab #54 #57
1 parent bcc7db0 commit 5bae34b

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

R/app_server.R

+16-2
Original file line numberDiff line numberDiff line change
@@ -842,6 +842,17 @@ app_server <- function( input, output, session ) {
842842
kableExtra::kable_styling("striped", full_width = F, position = "center")
843843
}
844844

845+
output$SolverTable <- function(){
846+
x <- as.data.frame(lh.params2()[c("S0","S1plus","AgeMat", "lambdaMax","K1plus","z")])
847+
x$z <- round(x$z, digits = 2)
848+
x$MNPL <- input$MNPL.usr
849+
kableExtra::kable(col.names = c('S<sub>0</sub.','S<sub>1+</sub>','Age at maturity','&#955 <sub>max</sub>','K<sub>1+</sub>','z', 'MNPL'),
850+
x, format = "html", # added format just now
851+
escape = FALSE) %>%
852+
kableExtra::column_spec(1, width = "10em") %>%
853+
kableExtra::kable_styling("striped", full_width = F, position = "center")
854+
}
855+
845856

846857
output$PMkite <- renderPlot({
847858
pt <- performance.table() %>%
@@ -1428,8 +1439,8 @@ app_server <- function( input, output, session ) {
14281439
br(),
14291440
plotOutput("BycatchIn")
14301441
) #/plots column (right)
1431-
) # end fluidRow
1432-
, # Performance measures
1442+
), # end fluidRow
1443+
# Performance measures
14331444
h4(i18n$t("Performance")),
14341445
p(i18n$t("This table shows median performance from all projections. If you entered multiple depletion levels in the Advanced Projections tab, this table is showing just the intermediate depletion level (the one you entered manually).")),
14351446
fluidRow(column(
@@ -1536,11 +1547,14 @@ app_server <- function( input, output, session ) {
15361547
downloadButton(outputId = "rawouts",
15371548
"Download raw projections")
15381549
), # end PBR tab
1550+
1551+
# Solve for bycatch -------------------------------------------------------
15391552
tabPanel(
15401553
i18n$t("Solve for Bycatch"),
15411554
h4(i18n$t("Calculate the bycatch rate necessary to achieve a recovery goal")),
15421555
p(i18n$t("If you have a specific management goal for your marine mammal population of interest, put in the desired recovery goal and timeline below. This part of the app will calculate an approximate bycatch rate that will allow the population to reach that goal. This page uses information from the 'Advanced Projections' tab to make this calculation. Once the plot appears, the animation will show the bycatch rates that the solver has attempted in its search for the maximum bycatch rate that will allow you to achieve your goal.")),
15431556
br(),
1557+
tableOutput("SolverTable"),
15441558
p(
15451559
strong(i18n$t("NOTE:")),
15461560
i18n$t("This will take a while! Make sure you are sure of your goals before clicking"),

0 commit comments

Comments
 (0)