Skip to content

Commit 497ef02

Browse files
committed
Add table with life history parameter inputs to PBR calculator tab #54
1 parent 3cd3c51 commit 497ef02

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

R/app_server.R

+18-2
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,7 @@ app_server <- function(input, output, session) {
857857
kableExtra::kable_styling("striped", full_width = F, position = "center")
858858
}
859859

860-
output$SolverTable <- function() {
860+
output$SolverTable1 <- function() {
861861
x <- as.data.frame(lh.params2()[c("S0", "S1plus", "AgeMat", "lambdaMax", "K1plus", "z")])
862862
x$z <- round(x$z, digits = 2)
863863
x$MNPL <- input$MNPL.usr
@@ -870,6 +870,18 @@ app_server <- function(input, output, session) {
870870
kableExtra::kable_styling("striped", full_width = F, position = "center")
871871
}
872872

873+
output$SolverTable2 <- function() {
874+
x <- as.data.frame(lh.params2()[c("S0", "S1plus", "AgeMat", "lambdaMax", "K1plus", "z")])
875+
x$z <- round(x$z, digits = 2)
876+
x$MNPL <- input$MNPL.usr
877+
kableExtra::kable(
878+
col.names = c("S<sub>0</sub.", "S<sub>1+</sub>", "Age at maturity", "&#955 <sub>max</sub>", "K<sub>1+</sub>", "z", "MNPL"),
879+
x, format = "html", # added format just now
880+
escape = FALSE
881+
) %>%
882+
kableExtra::column_spec(1, width = "10em") %>%
883+
kableExtra::kable_styling("striped", full_width = F, position = "center")
884+
}
873885

874886
output$PMkite <- renderPlot({
875887
pt <- performance.table() %>%
@@ -1510,6 +1522,10 @@ app_server <- function(input, output, session) {
15101522
helpText("$$ \\huge N_{MIN} \\cdot \\frac{1}{2}R_{MAX}\\cdot F_R$$"),
15111523
tags$div(HTML(i18n$t("<span class='help-block'>Note: To use this feature you need to have run projections in the Advanced tab. The values you need in order to calculate PBR are available in that tab. While the Advanced tab automatically calculates N<sub>MIN</sub> from the numbers you entered, you can use your own abundance estimates here if you want. Knowing carrying capacity and depletion is not required, only the abundance estimate and the CV of that estimate.</span>"))),
15121524
br(),
1525+
h4(i18n$t("Life history inputs")),
1526+
tableOutput("SolverTable1"),
1527+
br(),
1528+
h4(i18n$t("PBR inputs")),
15131529
fluidRow(
15141530
column(
15151531
6,
@@ -1579,7 +1595,7 @@ app_server <- function(input, output, session) {
15791595
h4(i18n$t("Calculate the bycatch rate necessary to achieve a recovery goal")),
15801596
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.")),
15811597
br(),
1582-
tableOutput("SolverTable"),
1598+
tableOutput("SolverTable2"),
15831599
p(
15841600
strong(i18n$t("NOTE:")),
15851601
i18n$t("This will take a while! Make sure you are sure of your goals before clicking"),

inst/Documentation/translation_m.json

+10
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,16 @@
406406
"es": "El enfoque PBR",
407407
"fr": "L’approche du PBR"
408408
},
409+
{
410+
"en": "Life history inputs",
411+
"es": "Parámetros de historia de vida ingresados",
412+
"fr": "Paramètres d’histoire de vie entrées"
413+
},
414+
{
415+
"en": "PBR inputs",
416+
"es": "PBR datos ingresados",
417+
"fr": "PBR entrées saisies"
418+
},
409419
{
410420
"en": "Potential Biological Removal (PBR) is the maximum number of animals, excluding natural mortalities, that may be removed from a marine mammal stock while allowing that stock to be at its optimum sustainable population (MMPA, sec. 3(20)).",
411421
"es": "La remoción biológica potencial (PBR en inglés) corresponde al número máximo de animales, excluyendo las mortalidades naturales, que se pueden eliminar de una población o stock de mamíferos marinos mientras se permite que dicha población se encuentre en su población óptima sostenible (MMPA, sec. 3 (20)).",

0 commit comments

Comments
 (0)