Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Impact démographique des collisions aviaires avec les éoliennes
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CEFE
Interactions Humains-Animaux
Impact démographique des collisions aviaires avec les éoliennes
Commits
14018c51
Commit
14018c51
authored
3 years ago
by
thierrychambert
Browse files
Options
Downloads
Patches
Plain Diff
Added the second table for "cumulated impacts" analysis (global impact)
parent
a123d11e
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inst/ShinyApp/server.R
+50
-33
50 additions, 33 deletions
inst/ShinyApp/server.R
inst/ShinyApp/ui.R
+5
-0
5 additions, 0 deletions
inst/ShinyApp/ui.R
with
55 additions
and
33 deletions
inst/ShinyApp/server.R
+
50
−
33
View file @
14018c51
...
...
@@ -1276,38 +1276,57 @@ server <- function(input, output, session){
## OUTPUTS
##-----------------------------------------------------------------------------------
##-------------------------------------------
## Impact
##-------------------------------------------
#######################################################################
## Impact : individual farms (for "cumulated impact" analysis only)
##---------------------------------------------------------------------
print_indiv_impact
<-
function
(){
req
(
out
$
run
)
res
=
get_metrics
(
N
=
out
$
run
$
N
,
cumulated_impacts
=
TRUE
)
n_farm
<-
(
dim
(
res
$
indiv_farm
$
impact
)[
3
]
-1
)
fil
<-
paste0
(
round
(
t
(
res
$
indiv_farm
$
impact
[
time_horzion
,
-2
,
-1
]),
2
)
*
100
,
"%"
)
matrix
(
fil
,
nrow
=
n_farm
,
dimnames
=
list
(
paste
(
"Parc"
,
1
:
n_farm
),
c
(
"Impact"
,
"IC (min)"
,
"IC (max)"
))
)
}
# end function print_impact
# Display title
output
$
title_indiv_impact_result
<-
renderText
({
req
(
input
$
run
>
0
,
out
$
analysis_choice
==
"cumulated"
)
"Rsultat : Impact de chaque parc olien, estim au bout de 30 ans"
})
# Display impact result (table)
output
$
indiv_impact_table
<-
renderTable
({
req
(
input
$
run
&
out
$
analysis_choice
==
"cumulated"
)
print_indiv_impact
()
},
rownames
=
TRUE
)
##################################################
## Impact : GLOBAL (for all types of analysis)
##------------------------------------------------
print_impact
<-
function
(){
req
(
out
$
run
)
# cumulated impact
if
(
param
$
cumulated_impacts
){
res
=
get_metrics
(
N
=
out
$
run
$
N
,
cumulated_impacts
=
TRUE
)
n_farm
<-
(
dim
(
res
$
indiv_farm
$
impact
)[
3
]
-1
)
fil
<-
paste0
(
round
(
t
(
res
$
indiv_farm
$
impact
[
time_horzion
,
-2
,
-1
]),
2
)
*
100
,
"%"
)
matrix
(
fil
,
nrow
=
n_farm
,
dimnames
=
list
(
paste
(
"Parc"
,
1
:
n_farm
),
c
(
"Impact"
,
"IC (min)"
,
"IC (max)"
))
)
# Not cumulated impacts
}
else
{
res
=
get_metrics
(
N
=
out
$
run
$
N
,
cumulated_impacts
=
FALSE
)
n_scen
<-
(
dim
(
res
$
scenario
$
impact
)[
3
]
-1
)
fil
<-
paste0
(
round
(
t
(
res
$
scenario
$
impact
[
time_horzion
,
-2
,
-1
]),
2
)
*
100
,
"%"
)
matrix
(
fil
,
nrow
=
n_scen
,
dimnames
=
list
(
paste
(
"Scenario"
,
1
:
n_scen
),
c
(
"Impact"
,
"IC (min)"
,
"IC (max)"
))
)
}
res
=
get_metrics
(
N
=
out
$
run
$
N
,
cumulated_impacts
=
FALSE
)
n_scen
<-
(
dim
(
res
$
scenario
$
impact
)[
3
]
-1
)
RowNam
<-
NULL
if
(
out
$
analysis_choice
==
"single_farm"
)
RowNam
<-
c
(
"Parc 1"
)
if
(
out
$
analysis_choice
==
"cumulated"
)
RowNam
<-
c
(
"Parc 1"
,
paste
(
"... + Parc"
,
(
2
:
n_scen
)))
if
(
out
$
analysis_choice
==
"multi_scenario"
)
RowNam
<-
paste
(
"Scenario"
,
(
1
:
n_scen
))
fil
<-
paste0
(
round
(
t
(
res
$
scenario
$
impact
[
time_horzion
,
-2
,
-1
]),
2
)
*
100
,
"%"
)
matrix
(
fil
,
nrow
=
n_scen
,
dimnames
=
list
(
RowNam
,
c
(
"Impact"
,
"IC (min)"
,
"IC (max)"
))
)
}
# end function print_impact
# Display title
output
$
title_impact_result
<-
renderText
({
if
(
input
$
run
>
0
){
"Rsultat : Impact estim au bout de 30 ans"
}
req
(
input
$
run
)
"Rsultat : Impact global estim au bout de 30 ans"
})
# Display impact result (table)
...
...
@@ -1317,8 +1336,7 @@ server <- function(input, output, session){
},
rownames
=
TRUE
)
##-------------------------------------------
#############################################
## Probability of extinction
##-------------------------------------------
print_PrExt
<-
function
(){
...
...
@@ -1340,9 +1358,8 @@ server <- function(input, output, session){
# Display title
output
$
title_PrExt_result
<-
renderText
({
if
(
input
$
run
>
0
){
"Rsultat : Probabilit d'extinction 30 ans"
}
req
(
input
$
run
)
"Rsultat : Probabilit d'extinction 30 ans"
})
# Display impact result (table)
...
...
@@ -1352,7 +1369,7 @@ server <- function(input, output, session){
},
rownames
=
TRUE
)
##
-------------------------------------------
##
###########################################
## Plot Impacts
##-------------------------------------------
## Function to plot the impact
...
...
@@ -1373,7 +1390,7 @@ server <- function(input, output, session){
plot_out_impact
()
})
##
-------------------------------------------
##
###########################################
## Plot Demographic Trajectories
##-------------------------------------------
# Function to plot trajectories
...
...
This diff is collapsed.
Click to expand it.
inst/ShinyApp/ui.R
+
5
−
0
View file @
14018c51
...
...
@@ -709,6 +709,11 @@ rm(list = ls(all.names = TRUE))
actionButton
(
inputId
=
"run"
,
label
=
"Lancer l'analyse"
),
hr
(),
span
(
textOutput
(
"title_indiv_impact_result"
),
align
=
"left"
,
style
=
"font-weight: bold; font-size: 18px;"
),
strong
(
span
(
tableOutput
(
"indiv_impact_table"
),
style
=
"color:orange; font-size:18px"
,
align
=
"left"
)),
hr
(),
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"
)),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment