Skip to content
Snippets Groups Projects
server.R 34.9 KiB
Newer Older
Marie-Bocage's avatar
Marie-Bocage committed

  # Display result (text for non cumulated impacts)
  output$impact_text <- renderText({
    }else{
      if(!param$cumulated_impacts){
        print_out()
      } else{
        NULL
      }
Marie-Bocage's avatar
Marie-Bocage committed

  # Display result (table for cumulated impacts)
  output$impact_table <- renderTable({
    if(input$run == 0){
      NULL
    }else{
      if(param$cumulated_impacts){
        print_out()
      } else{
        NULL
      }
    }
  }, rownames = TRUE)

  ##-------------------------------------------
  ## Plot Impacts
  ##-------------------------------------------
  ## Function to plot the impact
  plot_out_impact <- function(){
    if(is.null(out$run)) {} else {plot_impact(N = out$run$N, xlab = "year", ylab = "pop size")}
  }
  output$title_impact_plot <- renderText({
    if(input$run > 0){
      "Rsultat : Impact relatif au cours du temps"
    }
  })

  output$impact_plot <- renderPlot({
    plot_out_impact()
  })

  ##-------------------------------------------
  ## Plot Demographic Trajectories
  ##-------------------------------------------
  # Function to plot trajectories
  plot_out_traj <- function(){
    if(is.null(out$run)) {} else {plot_traj(N = out$run$N, xlab = "year", ylab = "pop size")}
  }

  output$graph_traj <- renderPlot({
    plot_out_traj()
  })
  #####
thierrychambert's avatar
thierrychambert committed
  ###################################################################################
thierrychambert's avatar
thierrychambert committed