Newer
Older
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Initial stuff
{
## Load libraries
library(shiny)
library(shinyjs)
library(shinyMatrix)
library(tidyverse)
library(eolpop)
## Load species list
species_data <- read.csv("./inst/ShinyApp/species_list.csv", sep = ",")
species_list <- unique(as.character(species_data$NomEspece)) %>% sort
species_list <- c(species_list, "Espce gnrique")
}
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Pre-fill data
{
## Data elicitation pre-fill data
# fatalities
eli_fatalities <- c(1.0, 2, 5, 8, 0.80,
0.2, 0, 3, 6, 0.90,
0.2, 2, 4, 10, 0.90,
0.1, 1, 3, 7, 0.70)
# population size
eli_pop_size <- c(1.0, 150, 200, 250, 0.80,
0.5, 120, 180, 240, 0.90,
0.8, 170, 250, 310, 0.90,
0.3, 180, 200, 230, 0.70)
# carrying capacity
eli_carrying_cap <- c(1.0, 500, 700, 1000, 0.80,
0.5, 1000, 1500, 2000, 0.90,
0.8, 800, 1200, 1600, 0.90,
0.3, 100, 1200, 1500, 0.70)
# population growth rate
eli_pop_growth <- c(1.0, -5, -2, 0, 0.95,
0.2, -3, 0, 1, 0.90,
0.5, -8, -4, -1, 0.90,
0.3, -10, -5, -2, 0.70)
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
titlePanel("eolpop : Impact demographique des collisions aviaires avec les oliennes"),
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
# Head Panel 1 : type of analysis and species
{wellPanel(
p("Choix d'analyse et espce", style="font-size:28px"),
{fluidRow(
# Select type of analysis : cumulated impacted or not
{column(width = 4,
# Choose analysis type (radioButton)
{radioButtons(inputId = "analysis_choice",
label = h4(strong("Type d'analyse"),
bsButton("Q_analysis_choice", label = "", icon = icon("question"), size = "extra-small"),
bsPopover(id = "Q_analysis_choice",
title = "Choix du type d\\'analyse",
content = HTML(
"<b>Impacts non cumuls</b> : pour analyser l\\'impact d\\'<b>un seul parc olien</b>. <br><br> <b>Impact cumuls</b> : pour analyser l\\'impact de <b>plusieurs parcs oliens</b> (attention : il faudra fournir des valeurs de mortalits propres chaque parc)."
),
placement = "right",
trigger = "click",
options = list(container='body')
)
),
choices = c("Impacts non cumuls" = "single_farm", "Impacts cumuls" = "cumulated", "Multiple scnarios" = "multi_scenario")
# Choose species (selectInput)
{selectInput(inputId = "species_choice",
selected = "Aigle de Bonelli", width = '80%',
label = h4(strong("Slectionner une espce"),
bsButton("Q_species_choice", label = "", icon = icon("question"), size = "extra-small"),
bsPopover(id = "Q_species_choice",
title = "Choix de l\\'espce",
content = HTML(
"Ncessaire pour fixer les valeurs de <b>paramtres dmographiques</b> (survie, fcondit). <br> La liste fournie correspond une liste d\\'espces prioritaires. Au besoin, une option \\'espce gnrique\\' est disponible la fin de la liste."
),
placement = "right",
trigger = "click",
options = list(container='body')
)
),
choices = species_list)},
br(),
# Show dispersal distances : mean and d = 5%
h4(strong("Distances de dispersion"),
bsButton("Q_dispersal_info", label = "", icon = icon("question"), size = "extra-small"),
bsPopover(id = "Q_dispersal_info",
title = "Distances de dispersion",
content = HTML(
"(1) <b>Distance moyenne de dispersion</b> de l\\'espce, estime partir des relations allomtriques publies dans l\\'article de Claramunt (2021).<br><br> (2) Distance quivalente un <b>taux de dispersion relatif de 3%, 5% et 10%</b>, sous l\\'hypothse que la distance de dispersion suit une loi exponentielle.<br><br><u>Reference cite</u> : Claramunt, S. (2021). Flight efficiency explains differences in natal dispersal distances in birds. <i>Ecology</i>, e03442."
),
placement = "right",
trigger = "click",
options = list(container='body')
)
),
#br(),
span(textOutput(outputId = "dispersal_mean_info"), style="font-size:16px"),
br(),
span(textOutput(outputId = "dispersal_d03p_info"), style="font-size:16px"),
span(textOutput(outputId = "dispersal_d05p_info"), style="font-size:16px"),
span(textOutput(outputId = "dispersal_d10p_info"), style="font-size:16px"),
# Show vital rate values (tableOutput)
h4(strong("Paramtres dmographiques"),
bsButton("Q_vital_rates_info", label = "", icon = icon("question"), size = "extra-small"),
bsPopover(id = "Q_vital_rates_info",
title = "Paramtres dmographiques",
content = HTML(
"Valeurs de <b>survie et fcondits par classe d\\'ge</b>, pour l\\'espce slectionne. <br><br><b>L\\'ge 0</b> (ex : Juv 0) correspond un individu n dans l\\'anne, n\\'ayant <u>pas encore</u> 1 an rvolu.<br><b>L\\'ge 1</b> correspond un individu ayant 1 an rvolu, donc dans sa 2<sup>e</sup> anne de vie.<br>Etc."
#"Valeurs de <b>survie et fcondits par classe d\\'ge</b>, pour l\\'espce slectionne. <br><br><b>Juv 0</b> correspond un individu n dans l\\'anne, n\\'ayant <u>pas encore</u> 1 an rvolu.<br><b>Juv 1</b> correspond un individu ayant 1 an rvolu, donc dans sa 2<sup>e</sup> anne de vie.<br>Etc."
),
placement = "right",
trigger = "click",
options = list(container='body')
)
),
), # close fluidRow
# Display the intrinsic lambda(i.e., based solely on the Leslie matrix)
# Output display (intrinsic lambda)
h5(strong("Taux de croissance intrinsque"),
bsButton("Q_lambda0_info", label = "", icon = icon("question"), size = "extra-small"),
bsPopover(id = "Q_lambda0_info",
title = "Taux de croissance intrinsque",
content = HTML(
"Taux de croissance bas seulement sur la matrice de Leslie (survies et fcondits de l\\'espce), <b> avant considration de la tendance de population locale</b>. <br><br>Ce taux de croissance est fourni simplement titre informatif. La valeur qui sera utilise dans les simulations correspond au taux de croissance fourni dans la partie \\'Taux de croissance\\'."
),
placement = "right",
trigger = "click",
options = list(container='body')
)
),
span(textOutput(outputId = "lambda0_info", inline = TRUE), style = "color:black; font-size:16px"),
## Modify vital rates, if needed (actionButton and matrixInput)
{column(width = 4,
tags$style(HTML('#button_vital_rates{background-color:#C2C8D3}')),
actionButton(inputId = "button_vital_rates",
label = tags$span("Modifier les paramtres dmographiques",
style = "font-weight: bold; font-size: 18px;")
),

thierrychambert
committed
br(" "),
numericInput(inputId = "vr_mat_number_age_classes",
label = "Nombre de classes d'age",
value = 3, min = 2, max = Inf, step = 1),

thierrychambert
committed
#br(),
matrixInput(inputId = "mat_fill_vr",
label = "",
value = matrix(data = NA, 3, 2,

thierrychambert
committed
dimnames = list(c("Juv 0", "Sub 1", "Adulte"), c("Survie", "Fcondit"))),
class = "numeric",
rows = list(names = TRUE),
cols = list(names = TRUE)
)
)}, # close column
)}, # End fluidRow
)}, # End wellPanel
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
# Head Panel 2 : Model parameters
{wellPanel(
## Enter parameter values (TITLE)
{p("Saisie des paramtres", style="font-size:28px",
bsButton("Q_param_enter", label = "", icon = icon("question"), size = "extra-small"),
bsPopover(id = "Q_param_enter",
title = "Saisie des paramtres pour l\\'analyse",
content = HTML(
"Cliquer sur les boutons ci-dessous pour saisir les valeurs des quatre paramtres requis pour l\\'analyse : <br>(1) Mortalits annuelles, <br>(2) Taille de la population, <br>(3) Tendance de la population, <br>(4) Capacit de charge."
),
placement = "right",
trigger = "click",
options = list(container='body')
)
{fluidRow(
##~~~~~~~~~~~~~~~~~~~~~~~~~
## 1. Fatalities
##~~~~~~~~~~~~~~~~~~~~~~~~~
{column(width = 3,
tags$style(HTML('#button_fatalities{background-color:#C2C8D3}')),
actionButton(inputId = "button_fatalities", width = '100%',
label = tags$span("Mortalits annuelles", style = "font-weight: bold; font-size: 18px;")
),
bsPopover(id = "button_fatalities",
title = "Mortalits annuelles",
content = HTML(
"Nombre de mortalits totales <b><u>annuelles</u> (cad. sur 12 mois) </b> attendues, pour l\\'espce slectionne, sur chaque parc olien concern (somme des mortalits attendues sur toutes les oliennes d\\'un parc)."
),
placement = "top",
trigger = "hover",
options = list(container='body')
),
### Part for non-cumulated impacts
# Input type
{conditionalPanel("output.hide_fatalities",
br(),
{wellPanel(style = "background:#FFF8DC",
radioButtons(inputId = "fatalities_unit", inline = FALSE,
label = "Unit",
choices = c("Nombre de mortalits" = "M",
"Taux de mortalit (%)" = "h"),
)}, # close wellPanel 1
{wellPanel(style = "background:#F0F8FF",
radioButtons(inputId = "fatalities_input_type",
label = "Type de saisie",
choices = c("Intervalle" = "itvl",
"Valeurs" = "val",
selected = "itvl"),
numericInput(inputId = "fatalities_lower",
label = "Borne infrieure (mortalits annuelles)",
min = 0, max = Inf, step = 0.5),
numericInput(inputId = "fatalities_upper",
label = "Borne suprieure (mortalits annuelles)",
min = 0, max = Inf, step = 0.5),
# Values
numericInput(inputId = "fatalities_mean",
label = "Moyenne (mortalits annuelles)",
min = 0, max = Inf, step = 0.5),
numericInput(inputId = "fatalities_se",
label = "Erreur-type (mortalits annuelles)",
min = 0, max = Inf, step = 0.1),
# Matrix for expert elicitation
numericInput(inputId = "fatalities_number_expert",
label = "Nombre d'experts",
value = 4, min = 1, max = Inf, step = 1),
matrixInput(inputId = "fatalities_mat_expert",
value = matrix(data = eli_fatalities, nrow = 4, ncol = 5,
dimnames = list(c("#1", "#2", "#3", "#4"),
c("Poids", "Min", "Best", "Max", "% IC" )),
byrow = TRUE),
class = "numeric",
rows = list(names = TRUE),
cols = list(names = TRUE)),
actionButton(inputId = "fatalities_run_expert", label = "Utiliser valeurs experts"),
### Part for cumulated impacts
numericInput(inputId = "farm_number_cumulated",
label = "Nombre de parcs oliens",
value = 3, min = 2, max = Inf, step = 1),
matrixInput(inputId = "fatalities_mat_cumulated",
label = span("Mortalits dans chaque parc",
bsButton("Q_fatalities_mat_cumulated", label = "", icon = icon("question"), size = "extra-small"),
bsPopover(id = "Q_fatalities_mat_cumulated",
title = "Mortalits cumules",
content = HTML(
"1 ligne = 1 parc <br><br>Les parcs doivent tre fournis dans l\\'<b>ordre chronologique</b> de leur mise en service (\\'Anne dbut\\'). <br><br>Pour chaque parc, veuillez indiquer la <u>moyenne</u> et l\\'<u>erreur-type</u> du nombre de mortalits estimes, ainsi que son <u>anne de mise en service</u>."
),
placement = "right",
trigger = "click",
options = list(container='body')
)
),
value = matrix(c(2, 0.5, 2010,
5, 0.5, 2015,
3, 0.5, 2018),
nrow = 3, ncol = 3, byrow = TRUE,
dimnames = list(c(paste0("Parc num.", c(1:3))),
c("Moyenne",
"Erreur-type",
"Anne de mise en service du parc"))),
class = "numeric",
rows = list(names = TRUE),
cols = list(names = TRUE)),
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
### Part for "scenarios option"
selectizeInput(inputId = "fatalities_vec_scenario",
label = HTML(
"Saisir chaque valeur de mortalit<br>
(sparer par un espace)"
),
choices = NULL,
multiple = TRUE,
options = list(
create = TRUE,
delimiter = ' ',
create = I("function(input, callback){
return {
value: input,
text: input
};
}")
)
),
)}, # close wellPanel
)}, # close conditional panel
)}, # end column "fatalities"
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
##~~~~~~~~~~~~~~~~~~~~~~~~~
## 2. Population Size
##~~~~~~~~~~~~~~~~~~~~~~~~~
{column(width = 3,
tags$style(HTML('#button_pop_size{background-color:#C2C8D3}')),
actionButton(inputId = "button_pop_size", width = '100%',
label = tags$span("Taille de la population", style = "font-weight: bold; font-size: 18px;")
),
bsPopover(id = "button_pop_size",
title = "Taille de la population",
content = HTML(
"Effectif de la population cible pour l\\'analyse d\\'impact. <br> Il peut s\\'agir soit du <b>nombre de couples</b>, soit de l\\'<b>effectif total</b> de la population (cad. toutes classes d\\'ge incluses)."
),
placement = "top",
trigger = "hover",
options = list(container='body')
),
{conditionalPanel("output.hide_pop_size",
br(),
{wellPanel(style = "background:#FFF8DC",
radioButtons(inputId = "pop_size_unit", inline = TRUE,
label = "Unit",
choices = c("Nombre de couples" = "Npair", "Effectif total" = "Ntotal"),
)}, # close wellPanel 1
{wellPanel(style = "background:#F0F8FF",
radioButtons(inputId = "pop_size_input_type",
label = "Type de saisie",
choices = c("Intervalle" = "itvl",
"Valeurs" = "val",
"Elicitation d'expert" = "eli_exp")),
# Interval
numericInput(inputId = "pop_size_lower",
label = "Borne infrieure (taille population)",
value = 750,
min = 0, max = Inf, step = 10),
numericInput(inputId = "pop_size_upper",
label = "Borne suprieure (taille population)",
value = 850,
min = 0, max = Inf, step = 10),
# Values
numericInput(inputId = "pop_size_mean",
label = "Moyenne de la taille de la population",
value = 800,
min = 0, max = Inf, step = 50),
numericInput(inputId = "pop_size_se",
label = "Erreur-type de la taille de la population",
min = 0, max = Inf, step = 1),
numericInput(inputId = "pop_size_number_expert",
label = "Nombre d'experts",
value = 4, min = 1, max = Inf, step = 1),
matrixInput(inputId = "pop_size_mat_expert",
value = matrix(data = eli_pop_size, nrow = 4, ncol = 5,
dimnames = list(c("#1", "#2", "#3", "#4"),
c("Poids", "Min", "Best", "Max", "% IC" )),
byrow = TRUE),
class = "numeric",
rows = list(names = TRUE),
cols = list(names = TRUE)),
actionButton(inputId = "pop_size_run_expert", label = "Utiliser valeurs experts"),
)}, # close wellPanel 2
# Display matrix for stable age distribution
h5(strong("Effectifs par classe d'ge")),
)}, # close conditional panel
)}, # end column "pop size"
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
##~~~~~~~~~~~~~~~~~~~~~~~~~
## 3. Population Growth
##~~~~~~~~~~~~~~~~~~~~~~~~~
{column(width = 3,
tags$style(HTML('#button_pop_growth{background-color:#C2C8D3}')),
actionButton(inputId = "button_pop_growth", width = '100%',
label = tags$span("Taux de croissance", style = "font-weight: bold; font-size: 18px;")
bsPopover(id = "button_pop_growth",
title = "Taux de croissance",
"Taux d\\'accroissement annuel de la population <b>en %</b> : valeur positive pour une population en croissance; valeur <b>ngative</b> pour une population en <b>dclin</b> (ex : -4 pour un dclin de 4% par an) ; 0 pour une population stable.<br><br>A dfaut, on pourra juste cocher la <b>tendance globale</b> (dclin, stabilit ou croissance) et l\\'intensit de cette tendance (faible, moyenne, forte)."
placement = "top",
trigger = "hover",
options = list(container='body')
),
{conditionalPanel("output.hide_pop_growth",
br(),
{wellPanel(style = "background:#F0F8FF",
radioButtons(inputId = "pop_growth_input_type",
label = "Type de saisie",
choices = c("Intervalle" = "itvl",
"Elicitation d'expert" = "eli_exp",
"Tendance population" = "trend")),
# Interval
numericInput(inputId = "pop_growth_lower",
label = HTML("Borne infrieure<br>(taux d'accroissement en %)"),

thierrychambert
committed
min = -100, max = Inf, step = 1),
numericInput(inputId = "pop_growth_upper",
label = HTML("Borne suprieure<br>(taux d'accroissement en %)"),

thierrychambert
committed
min = -100, max = Inf, step = 1),
numericInput(inputId = "pop_growth_mean",
label = "Moyenne (taux d'accroissement en %)",

thierrychambert
committed
min = -100, max = Inf, step = 1),
numericInput(inputId = "pop_growth_se",
label = "Erreur-type (aussi en %)",
min = 0, max = Inf, step = 0.5),
numericInput(inputId = "pop_growth_number_expert",
label = "Nombre d'experts",
value = 4, min = 1, max = Inf, step = 1),
matrixInput(inputId = "pop_growth_mat_expert",
value = matrix(data = eli_pop_growth, nrow = 4, ncol = 5,
dimnames = list(c("#1", "#2", "#3", "#4"),
c("Poids", "Min", "Best", "Max", "% IC" )),
byrow = TRUE),
class = "numeric",
rows = list(names = TRUE),
cols = list(names = TRUE)),
actionButton(inputId = "pop_growth_run_expert", label = "Utiliser valeurs experts"),
## Input trend: radio buttons
{fluidRow(
# Trend
column(6,
radioButtons(inputId = "pop_trend",
label = "Tendance",
choices = c("En croissance" = "growth",
"Stable" = "stable",
),
# Strength of trend
column(6,
radioButtons(inputId = "pop_trend_strength",
choices = c("Faible" = "weak",
"Moyenne" = "average",
"Forte" = "strong")),
actionButton(inputId = "button_calibrate_vr", label = "Calibrer survies et fcondits"),
)}, # close wellPanel
)}, # close conditional panel
)}, # end column "pop growth"
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
##~~~~~~~~~~~~~~~~~~~~~~~~~
## 4. Carrying capacity
##~~~~~~~~~~~~~~~~~~~~~~~~~
{column(width = 3,
tags$style(HTML('#button_carrying_cap{background-color:#C2C8D3}')),
actionButton(inputId = "button_carrying_cap", width = '100%',
label = tags$span("Capacit de charge", style = "font-weight: bold; font-size: 18px;")
),
bsPopover(id = "button_carrying_cap",
"La capacit de charge (K) correspond la <b>taille maximale que peut atteindre la population</b> dans son environnement et les limites spatiales considres. <br><br><u>Note:</u> Ce chiffre sera exprim dans la <b>mme unit</b> que la taille de population (cad. nombre de couples ou effectif total). <br>Il n\\'a pas besoin d\\'tre trs prcis ; il doit simplement fournir un ordre de grandeur de la taille limite au-del de laquelle la population ne peut plus crotre (environnement local satur)."
),
placement = "top",
trigger = "hover",
options = list(container='body')
),
{conditionalPanel("output.hide_carrying_cap",
br(),
{wellPanel(style = "background:#FFF8DC",
span(textOutput(outputId = "carrying_cap_unit_info"), style="font-size:16px"),
)}, # close wellPanel 1
{wellPanel(style = "background:#F0F8FF",
radioButtons(inputId = "carrying_cap_input_type",
label = "Type de saisie",
choices = c("Intervalle" = "itvl",
"Valeur" = "val",
"Elicitation d'expert" = "eli_exp",
# Interval
numericInput(inputId = "carrying_capacity_lower",
label = "Borne infrieure (capacit de charge)",
value = 850,
min = 0, max = Inf, step = 100),
numericInput(inputId = "carrying_capacity_upper",
label = "Borne suprieure (capacit de charge)",
value = 1250,
min = 0, max = Inf, step = 100),
# Values
numericInput(inputId = "carrying_capacity_mean",
label = "Moyenne de la capacit de charge",
min = 0, max = Inf, step = 100),
numericInput(inputId = "carrying_capacity_se",
label = "Erreur-type de la capacit de charge",
value = 100,
min = 0, max = Inf, step = 50),
# Expert Elicitation Matrix
numericInput(inputId = "carrying_cap_number_expert",
label = "Nombre d'experts",
value = 4, min = 1, max = Inf, step = 1),
matrixInput(inputId = "carrying_cap_mat_expert",
value = matrix(data = eli_carrying_cap, nrow = 4, ncol = 5,
dimnames = list(c("#1", "#2", "#3", "#4"),
c("Poids", "Min", "Best", "Max", "% IC" )),
byrow = TRUE),
class = "numeric",
rows = list(names = TRUE),
cols = list(names = TRUE)),
actionButton(inputId = "carrying_cap_run_expert", label = "Utiliser valeurs experts"),
)}, # close wellPanel 2
)}, # close conditional panel
)}, # end column "carrying capacity"
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
)}, # # End wellPanel
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
{sidebarLayout(
p("Valeurs slectionnes", style="font-size:24px",
bsButton("Q_selected_values", label = "", icon = icon("question"), size = "extra-small"),
bsTooltip(id = "Q_selected_values",
title = "Rappel des valeurs de paramtres actuellement slectionnes.",
placement = "right",
trigger = "click",
options = list(container='body')
)
),
# Mortalites annuelles
span("Mortalits annuelles", style="font-size:18px; font-weight: bold"),
shiny::tags$i(textOutput(outputId = "fatalities_unit_info"), style="font-size:15px"),
span(textOutput(outputId = "fatalities_mean_info"), style="font-size:15px"),
span(textOutput(outputId = "fatalities_se_info"), style="font-size:15px"),
span("Taille de la population", style="font-size:18px; font-weight: bold"),
shiny::tags$i(textOutput(outputId = "pop_size_unit_info"), style="font-size:15px"),
span(textOutput(outputId = "pop_size_mean_info"), style="font-size:15px"),
span(textOutput(outputId = "pop_size_se_info"), style="font-size:15px"),
span(HTML("Taux de croissance (λ)"), style="font-size:18px; font-weight: bold"),
span(textOutput(outputId = "pop_growth_mean_info"), style="font-size:15px"),
span(textOutput(outputId = "pop_growth_se_info"), style="font-size:15px"),
# Capacite de charge
span("Capacit de charge", style="font-size:18px; font-weight: bold"),
shiny::tags$i(textOutput(outputId = "carrying_capacity_unit_info"), style="font-size:15px"),
span(textOutput(outputId = "carrying_capacity_mean_info"), style="font-size:15px"),
span(textOutput(outputId = "carrying_capacity_se_info"), style="font-size:15px"),
#~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
## Parameter distribution
{tabPanel(title = "Distribution paramtres",
span(textOutput(outputId = "title_distri_plot"), style="font-size:24px; font-weight:bold"),
plotOutput(outputId = "distri_plot"),
## Population Impact : simulations
{tabPanel(title = "Impact population",
label = "Nombre d'annes",
value = 30, min = 5, max = Inf, step = 10),
br(),
numericInput(inputId = "nsim",
label = "Nombre de simulations",
value = 10, min = 0, max = Inf, step = 10),
actionButton(inputId = "run", label = "Lancer l'analyse"),
br(" "),
span(textOutput("run_time"), align = "left", style = "font-weight: normal; font-size: 16px;"),
#hr(),
#br(),
#actionButton(inputId = "show_results", label = "Rsultats"),
#p("Rsultats", style="font-size:28px"),
## Report
{tabPanel(title = "Rapport",
br(" "),
textAreaInput("intro_report", label = "Contexte de l'tude", value = "Analyse ralise dans le cadre de ...", width = "1000px"),
br(" "),
textAreaInput("def_pop_text", label = "Dlimitation de la population",
value = "Veuillez dcrire ici l'approche et les informations utilises pour dlimiter la population concerne par cette tude d'impact dmographique",
width = "1000px"),
br(" "),
downloadButton("report", "Generate report")
)} # End tabPanel
) # End tabSetPanel
)} # End mainPanel
###############################################################################################################################
hr(),
## Results : text
{sidebarLayout(
## Side Panel
{conditionalPanel("output.hide_show_CI",
{sidebarPanel(
##
## Choose CI
sliderInput("show_CI", label = "Intervalle de confiance (%)", min = 0, max = 100, value = 95, step = 1),
hr(),
)}, # End sidebarPanel
)}, # close conditional panel
#######################################################
{mainPanel(
## Outputs
{conditionalPanel("output.hide_results",
##
# Text : Global impact
{column(
width = 7,
span(textOutput("title_impact_result"), align = "left", style = "font-weight: bold; font-size: 18px;"),
strong(span(tableOutput("impact_table"), style="color:blue; font-size:18px", align = "left")),
)},
{column(
width = 5,
span(textOutput("title_PrExt_result"), align = "left", style = "font-weight: bold; font-size: 18px;"),
strong(span(tableOutput("PrExt_table"), style="color:orange; font-size:18px", align = "left")),
)},
##
)}, # close conditional panel
)}, # End mainPanel
###############################################################################################################################
hr(),
## Results : Graphs
{sidebarLayout(
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
## Side Panel
{conditionalPanel("output.hide_graph_choice",
{sidebarPanel(
##
## Choose which graph to show
radioButtons("choose_graph", label = h5(strong("Graphique (choix)")),
choices = c(
"Impact final : densit de probabilit" = "show_PDF",
"Impact final : probabilit cumule" = "show_ECDF",
"Impact relatif au cours du temps" = "show_impact_time",
"Projections dmographiques" = "show_demog_proj"
)),
br(),
## Choose "scenario" to show
radioButtons("show_scenario", label = h5(strong("Choix du scnario")),
choices = c("all")),
br(),
hr(),
br(),
## Choose "quantile" : level of under-estimation risk (1 - QT)
conditionalPanel("output.hide_risk_A",
wellPanel(style = "background:#F0F8FF",
sliderInput("risk_A", label = "Risque (%) de sous-estimation de l'impact", min = 0, max = 100, value = 5, step = 0.5),
)
), # close conditional panel
##
)}, # End sidebarPanel
)}, # close conditional panel
#######################################################
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
{mainPanel(
## Graph : Probability Density (PDF)
{conditionalPanel("output.hide_graph_PDF",
tags$h4(textOutput("title_PDF_plot"), align = "center"),
plotOutput("PDF_plot", width = "100%", height = "550px"),
)}, # close conditional panel
## Graph : Cumulative Distibution (ECDF)
{conditionalPanel("output.hide_graph_ECDF",
tags$h4(textOutput("title_ECDF_plot"), align = "center"),
plotOutput("ECDF_plot", width = "100%", height = "550px"),
)}, # close conditional panel
## Graph : Relative Impact over time
{conditionalPanel("output.hide_graph_impact_time",
tags$h4(textOutput("title_impact_plot"), align = "center"),
plotOutput("impact_plot", width = "100%", height = "550px"),
)}, # close conditional panel
## Graph : Population trajectory (pop size over time)
{conditionalPanel("output.hide_graph_demog_proj",
tags$h4(textOutput("title_traj_plot"), align = "center"),
br(),
wellPanel(
span(textOutput("warning_traj_plot"), align = "left", style = "font-size: 14px;"),
),
br(" "),
radioButtons(inputId = "age_class_show",
label = "Classes d'ge inclure sur le graphe",
choices = c("Tous ges sauf juvniles" = "NotJuv0",
"Tous ges, y compris juvniles" = "all",
"Nombre de couples" = "pairs"),
inline = TRUE
),
plotOutput("traj_plot", width = "100%", height = "550px")
##
)}, # close conditional panel
# End UI #~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###