Skip to content
Snippets Groups Projects
Commit e6a085b0 authored by thierrychambert's avatar thierrychambert
Browse files

Added buttons show_distri

parent 649fd557
No related branches found
No related tags found
No related merge requests found
rm(list = ls(all.names = TRUE))
setwd( paste0(getwd(),"/inst/ShinyApp/") )
getwd()
......
......@@ -765,7 +765,7 @@ server <- function(input, output, session){
##----------------------
observeEvent({
input$analysis_choice
input$button_fatalities
input$show_ditri_fatalities
input$fatalities_input_type
input$fatalities_run_expert
input$farm_number_cumulated
......@@ -776,7 +776,7 @@ server <- function(input, output, session){
if(input$analysis_choice == "single_farm"){
# Show from input values: if button is ON and input_type is set on "value" or "itvl" (thus not "eli_exp")
if(input$button_fatalities%%2 == 1 & input$fatalities_input_type != "eli_exp"){
if(input$fatalities_input_type != "eli_exp"){
output$title_distri_plot <- renderText({ "Mortalits annuelles" })
output$distri_plot <- renderPlot({
......@@ -792,7 +792,7 @@ server <- function(input, output, session){
} else {
# Show from elicitation expert: if button is ON and input_type is set on "expert elicitation"
if(input$button_fatalities%%2 == 1 & input$fatalities_input_type == "eli_exp"){
if(input$fatalities_input_type == "eli_exp"){
if(!is.null(param$fatalities_eli_result)){
output$title_distri_plot <- renderText({ "Mortalits annuelles" })
output$distri_plot <- renderPlot({ plot_expert(param$fatalities_eli_result$out) })
......@@ -835,11 +835,11 @@ server <- function(input, output, session){
## Population size
##----------------------
observeEvent({
input$button_pop_size
input$show_ditri_pop_size
input$pop_size_input_type
},{
# Show from input values: if button is ON and input_type is set on "value"
if(input$button_pop_size%%2 == 1 & input$pop_size_input_type != "eli_exp"){
if(input$pop_size_input_type != "eli_exp"){
output$title_distri_plot <- renderText({ "Taille initiale de la population" })
output$distri_plot <- renderPlot({
......@@ -849,7 +849,7 @@ server <- function(input, output, session){
} else {
# Show from elicitation expert: if button is ON and input_type is set on "expert elicitation"
if(input$button_pop_size%%2 == 1 & input$pop_size_input_type == "eli_exp"){
if(input$pop_size_input_type == "eli_exp"){
if(!is.null(param$pop_size_eli_result)){
output$title_distri_plot <- renderText({ "Taille initiale de la population" })
output$distri_plot <- renderPlot({ plot_expert(param$pop_size_eli_result$out) })
......@@ -871,11 +871,11 @@ server <- function(input, output, session){
##----------------------
observeEvent({
input$pop_growth_input_type
input$button_pop_growth
input$show_ditri_pop_growth
},{
# Show from input values: if button is ON and input_type is set on "value" or "interval"
if(input$button_pop_growth%%2 == 1 & input$pop_growth_input_type != "eli_exp" & input$pop_growth_input_type != "trend"){
if(input$pop_growth_input_type != "eli_exp" & input$pop_growth_input_type != "trend"){
output$title_distri_plot <- renderText({ "Taux de croissance de la population" })
output$distri_plot <- renderPlot({
......@@ -885,7 +885,7 @@ server <- function(input, output, session){
} else {
# Show from elicitation expert: if button is ON and input_type is set on "expert elicitation"
if(input$button_pop_growth%%2 == 1 & input$pop_growth_input_type == "eli_exp"){
if(input$pop_growth_input_type == "eli_exp"){
if(!is.null(param$pop_growth_eli_result)){
output$title_distri_plot <- renderText({ "Taux de croissance de la population" })
output$distri_plot <- renderPlot({ plot_expert(param$pop_growth_eli_result$out) })
......@@ -906,10 +906,10 @@ server <- function(input, output, session){
##----------------------
observeEvent({
input$carrying_cap_input_type
input$button_carrying_cap
input$show_ditri_carrying_cap
},{
# Show from input values: if button is ON and input_type is set on "value"
if(input$button_carrying_cap%%2 == 1 & input$carrying_cap_input_type != "eli_exp"){
if(input$carrying_cap_input_type != "eli_exp"){
output$title_distri_plot <- renderText({ "Capacit de charge" })
output$distri_plot <- renderPlot({
......@@ -919,7 +919,7 @@ server <- function(input, output, session){
} else {
# Show from elicitation expert: if button is ON and input_type is set on "expert elicitation"
if(input$button_carrying_cap%%2 == 1 & input$carrying_cap_input_type == "eli_exp"){
if(input$carrying_cap_input_type == "eli_exp"){
if(!is.null(param$carrying_cap_eli_result)){
if(!is.na(param$carrying_cap_eli_result$out)){
output$title_distri_plot <- renderText({ "Capacit de charge" })
......
......@@ -444,7 +444,6 @@ h4{
## 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;")
......@@ -501,7 +500,6 @@ h4{
##~~~~~~~~~~~~~~~~~~~~~~~~~
{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;")
),
......@@ -540,12 +538,12 @@ h4{
# Interval
numericInput(inputId = "fatalities_lower",
label = "Borne infrieure (mortalits annuelles)",
value = 1,
value = 5,
min = 0, max = Inf, step = 0.5),
numericInput(inputId = "fatalities_upper",
label = "Borne suprieure (mortalits annuelles)",
value = 1,
value = 10,
min = 0, max = Inf, step = 0.5),
# Values
......@@ -595,9 +593,9 @@ h4{
options = list(container='body')
)
),
value = matrix(c(1, 0, 2011,
2, 0, 2012,
3, 0, 2013),
value = matrix(c(2, 0.5, 2011,
5, 0.5, 2012,
10, 0.5, 2013),
nrow = 3, ncol = 3, byrow = TRUE,
dimnames = list(c(paste0("Parc num.", c(1:3))),
c("Valeur centrale",
......@@ -647,7 +645,6 @@ h4{
##~~~~~~~~~~~~~~~~~~~~~~~~~
{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;")
),
......@@ -688,7 +685,7 @@ h4{
numericInput(inputId = "pop_size_upper",
label = "Borne suprieure (taille population)",
value = 500,
value = 700,
min = 0, max = Inf, step = 10),
# Values
......@@ -735,7 +732,6 @@ h4{
##~~~~~~~~~~~~~~~~~~~~~~~~~
{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;")
),
......@@ -768,7 +764,7 @@ h4{
numericInput(inputId = "pop_growth_upper",
label = HTML("Borne suprieure<br>(taux d'accroissement en %)"),
value = -2,
value = -3,
min = -100, max = Inf, step = 1),
## Input values: mean and se
......@@ -836,7 +832,6 @@ h4{
##~~~~~~~~~~~~~~~~~~~~~~~~~
{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;")
),
......@@ -877,7 +872,7 @@ h4{
numericInput(inputId = "carrying_capacity_upper",
label = "Borne suprieure (capacit de charge)",
value = 1000,
value = 1500,
min = 0, max = Inf, step = 100),
# Values
......@@ -977,6 +972,10 @@ h4{
## Parameter distribution
{tabPanel(title = "Distribution paramtres",
actionButton("show_ditri_fatalities", label = "Mortalits annuelles"),
actionButton("show_ditri_pop_size", label = "Taille de la population"),
actionButton("show_ditri_pop_growth", label = "Taux de croissance"),
actionButton("show_ditri_carrying_cap", label = "Capacit de charge"),
span(textOutput(outputId = "title_distri_plot"), style="font-size:24px; font-weight:bold"),
plotOutput(outputId = "distri_plot"),
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment