Newer
Older
lci = get_metrics(N = out$run$N)$scenario$impact[time_horzion, "lci",-1],
uci = get_metrics(N = out$run$N)$scenario$impact[time_horzion, "uci",-1])
}

thierrychambert
committed
} else {
# When run is NULL
if(!is.null(out$msg)){
# Print the error msg, if there is one
if(out$msg == "error_not_ready"){
paste0("Erreur: Vous n'avez pas lancer l'analyse 'valeurs experts'")
}else{
paste0("Some other error occurred")
}
}else{
# When no error msg : nothing happens
} # if "msg"
} # if "run
} # end function print_out
# Display title
output$title_impact_result <- renderText({
if(input$run > 0){
"Rsultat : Impact estim au bout de 30 ans"
}
})
# Display result (text for non cumulated impacts)
output$impact_text <- renderText({
if(input$run == 0){
}else{
if(!param$cumulated_impacts){
print_out()
} else{
NULL
}
# 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, onset_year = param$onset_year, percent = TRUE,
xlab = "\nAnne", ylab = "Impact relatif (%)\n")
}
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$title_traj_plot <- renderText({
if(input$run > 0){
"Graphique : Trajectoire dmographique"
}
})
output$traj_plot <- renderPlot({
plot_out_traj()
})
#####
###################################################################################