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
7551911b
Commit
7551911b
authored
3 years ago
by
thierrychambert
Browse files
Options
Downloads
Patches
Plain Diff
More cleaning
Check run issue with run analysis (works again...)
parent
35d33f10
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
inst/ShinyApp/server.R
+68
-54
68 additions, 54 deletions
inst/ShinyApp/server.R
inst/ShinyApp/ui.R
+6
-4
6 additions, 4 deletions
inst/ShinyApp/ui.R
run_analysis.R
+31
-11
31 additions, 11 deletions
run_analysis.R
with
105 additions
and
69 deletions
inst/ShinyApp/server.R
+
68
−
54
View file @
7551911b
...
...
@@ -41,11 +41,11 @@ server <- function(input, output, session){
if
(
input
$
analysis_choice
==
"scenario"
){
shinyjs
::
show
(
"fatalities_input_type"
)
if
(
input
$
fatalities_input_type
==
"
V
al
eurs
"
){
if
(
input
$
fatalities_input_type
==
"
v
al"
){
shinyjs
::
show
(
"fatalities_mean"
)
shinyjs
::
show
(
"fatalities_se"
)
}
if
(
input
$
fatalities_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
fatalities_input_type
==
"
e
li
_exp
"
){
shinyjs
::
show
(
"fatalities_mat_expert"
)
shinyjs
::
show
(
"fatalities_run_expert"
)
}
...
...
@@ -65,11 +65,11 @@ server <- function(input, output, session){
if
(
input
$
button_pop_size
%%
2
==
1
){
shinyjs
::
show
(
"pop_size_type"
)
shinyjs
::
show
(
"pop_size_input_type"
)
if
(
input
$
pop_size_input_type
==
"
V
al
eurs
"
){
if
(
input
$
pop_size_input_type
==
"
v
al"
){
shinyjs
::
show
(
"pop_size_mean"
)
shinyjs
::
show
(
"pop_size_se"
)
}
if
(
input
$
pop_size_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
pop_size_input_type
==
"
e
li
_exp
"
){
shinyjs
::
show
(
"pop_size_mat_expert"
)
shinyjs
::
show
(
"pop_size_run_expert"
)
}
...
...
@@ -79,10 +79,10 @@ server <- function(input, output, session){
if
(
input
$
button_carrying_cap
%%
2
==
1
){
shinyjs
::
show
(
"carrying_cap_input_type"
)
if
(
input
$
carrying_cap_input_type
==
"
V
al
eurs
"
){
if
(
input
$
carrying_cap_input_type
==
"
v
al"
){
shinyjs
::
show
(
"carrying_capacity"
)
}
if
(
input
$
carrying_cap_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
carrying_cap_input_type
==
"
e
li
_exp
"
){
shinyjs
::
show
(
"carrying_cap_mat_expert"
)
shinyjs
::
show
(
"carrying_cap_run_expert"
)
}
...
...
@@ -92,15 +92,15 @@ server <- function(input, output, session){
if
(
input
$
button_pop_trend
%%
2
==
1
){
shinyjs
::
show
(
"pop_growth_input_type"
)
if
(
input
$
pop_growth_input_type
==
"
Taux de croissance
"
){
if
(
input
$
pop_growth_input_type
==
"
val
"
){
shinyjs
::
show
(
"pop_growth_mean"
)
shinyjs
::
show
(
"pop_growth_se"
)
}
if
(
input
$
pop_growth_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
pop_growth_input_type
==
"
e
li
_exp
"
){
shinyjs
::
show
(
"pop_growth_mat_expert"
)
shinyjs
::
show
(
"pop_growth_run_expert"
)
}
if
(
input
$
pop_growth_input_type
==
"
T
end
ance locale ou rgionale
"
){
if
(
input
$
pop_growth_input_type
==
"
tr
end"
){
shinyjs
::
show
(
"pop_trend"
)
shinyjs
::
show
(
"pop_trend_strength"
)
}
...
...
@@ -280,13 +280,11 @@ server <- function(input, output, session){
##--------------------------------------------
##
Observe input and report values
--
##
Select parameter values for simulations
--
##--------------------------------------------
## Cumulated impacts or not ?
## Cumulated impacts or not ? ###~~~~~~~~~~~~~~~~~~~~~~~~~~###
observeEvent
({
input
$
run
},
{
...
...
@@ -298,19 +296,7 @@ server <- function(input, output, session){
})
# end observeEvent
### Plot distribution
##--------------------------------------------
## Select parameter values for simulations --
##--------------------------------------------
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
## Fatalities ###~~~~~~~~~~~~~~~~~~~~~~~~~~###
observeEvent
({
input
$
run
...
...
@@ -319,7 +305,7 @@ server <- function(input, output, session){
if
(
input
$
analysis_choice
==
"scenario"
){
# Case 1.1 : Values from expert elicitation (if2)
if
(
input
$
fatalities_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
fatalities_input_type
==
"
e
li
_exp
"
){
param
$
fatalities_mean
<-
c
(
0
,
round
(
param
$
fatalities_eli_result
$
mean
))
param
$
onset_time
<-
NULL
param
$
fatalities_se
<-
c
(
0
,
round
(
param
$
fatalities_eli_result
$
SE
))
...
...
@@ -341,18 +327,24 @@ server <- function(input, output, session){
}
# end (if1)
})
# end observeEvent
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~###
## Population size ###~~~~~~~~~~~~~~~~~~~~~~~~~~###
observeEvent
({
input
$
run
},{
# Observe pop size value
## Mean, se and type
observeEvent
({
input
$
run
},{
if
(
input
$
pop_size_input_type
==
"Elicitation d'expert"
){
# Case 1 : Values from expert elicitation
if
(
input
$
pop_size_input_type
==
"eli_exp"
){
if
(
!
(
is.null
(
param
$
pop_size_eli_result
))){
param
$
pop_size_mean
<-
round
(
param
$
pop_size_eli_result
$
mean
)
param
$
pop_size_se
<-
round
(
param
$
pop_size_eli_result
$
SE
)
}
else
{
print
(
"
#intgrer un message d'erreur
"
)
print
(
"
Erreur: Vous n'avez pas lancer l'analyse 'valeurs experts'
"
)
}
# Case 2 : Values directly provided (i.e., not from expert elicitation)
}
else
{
param
$
pop_size_mean
<-
input
$
pop_size_mean
param
$
pop_size_se
<-
input
$
pop_size_se
...
...
@@ -360,16 +352,25 @@ server <- function(input, output, session){
param
$
pop_size_type
<-
input
$
pop_size_type
})
# Observe pop growth value
observeEvent
({
input
$
run
},
{
if
(
input
$
pop_growth_input_type
==
"Elicitation d'expert"
){
###~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~##
## Population growth ###~~~~~~~~~~~~~~~~~~~~~~~~~~###
observeEvent
({
input
$
run
},
{
# Case 1 : Values from expert elicitation
if
(
input
$
pop_growth_input_type
==
"eli_exp"
){
if
(
!
(
is.null
(
param
$
pop_growth_eli_result
))){
param
$
pop_growth_mean
<-
round
(
min
(
1
+
param
$
rMAX_species
,
round
(
param
$
pop_growth_eli_result
$
mean
,
2
)),
2
)
param
$
pop_growth_se
<-
round
(
param
$
pop_growth_eli_result
$
SE
,
2
)
}
else
{
print
(
"
#intgrer un message d'erreur
"
)
print
(
"
Erreur: Vous n'avez pas lancer l'analyse 'valeurs experts'
"
)
}
}
else
if
(
input
$
pop_growth_input_type
==
"Tendance locale ou rgionale"
){
# Case 2 : Trend information
}
else
if
(
input
$
pop_growth_input_type
==
"trend"
){
if
(
input
$
pop_trend
==
"Croissance"
)
{
if
(
input
$
pop_trend_strength
==
"Faible"
)
{
param
$
pop_growth_mean
<-
1.01
...
...
@@ -390,8 +391,9 @@ server <- function(input, output, session){
param
$
pop_growth_mean
<-
1
}
param
$
pop_growth_se
<-
0.03
}
else
{
# Case 3 : Values directly provided (i.e., not from expert elicitation)
}
else
{
param
$
pop_growth_mean
<-
round
(
min
(
1
+
param
$
rMAX_species
,
input
$
pop_growth_mean
),
2
)
param
$
pop_growth_se
<-
input
$
pop_growth_se
}
...
...
@@ -420,7 +422,7 @@ server <- function(input, output, session){
# Observe carrying capacity
observeEvent
({
input
$
run
},
{
if
(
input
$
carrying_cap_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
carrying_cap_input_type
==
"
e
li
_exp
"
){
if
(
!
(
is.null
(
param
$
carrying_cap_eli_result
))){
param
$
carrying_capacity
<-
round
(
param
$
carrying_cap_eli_result
$
mean
)
}
else
{
...
...
@@ -505,12 +507,13 @@ server <- function(input, output, session){
## Fatalities
output
$
fatalities_mean_info
<-
renderText
({
if
(
input
$
fatalities_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
fatalities_input_type
==
"
e
li
_exp
"
){
if
(
!
(
is.null
(
param
$
fatalities_eli_result
))){
info
<-
round
(
param
$
fatalities_eli_result
$
mean
,
2
)
}
else
{
info
<-
NA
}
}
else
{
info
<-
NA
}
}
else
{
info
<-
input
$
fatalities_mean
...
...
@@ -519,10 +522,12 @@ server <- function(input, output, session){
})
output
$
fatalities_se_info
<-
renderText
({
if
(
input
$
fatalities_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
fatalities_input_type
==
"
e
li
_exp
"
){
if
(
!
(
is.null
(
param
$
fatalities_eli_result
))){
info
<-
round
(
param
$
fatalities_eli_result
$
SE
)
}
else
{
info
<-
NA
}
info
<-
round
(
param
$
fatalities_eli_result
$
SE
,
2
)
}
else
{
info
<-
NA
}
}
else
{
info
<-
input
$
fatalities_se
...
...
@@ -530,6 +535,15 @@ server <- function(input, output, session){
paste0
(
"Erreur-type : "
,
info
)
})
## Poplutation size
output
$
pop_size_type_info
<-
renderText
({
...
...
@@ -541,7 +555,7 @@ server <- function(input, output, session){
})
output
$
pop_size_mean_info
<-
renderText
({
if
(
input
$
pop_size_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
pop_size_input_type
==
"
e
li
_exp
"
){
if
(
!
(
is.null
(
param
$
pop_size_eli_result
))){
info
<-
round
(
param
$
pop_size_eli_result
$
mean
)
}
else
{
info
<-
NA
}
...
...
@@ -553,7 +567,7 @@ server <- function(input, output, session){
})
output
$
pop_size_se_info
<-
renderText
({
if
(
input
$
pop_size_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
pop_size_input_type
==
"
e
li
_exp
"
){
if
(
!
(
is.null
(
param
$
pop_size_eli_result
))){
info
<-
round
(
param
$
pop_size_eli_result
$
SE
)
}
else
{
info
<-
NA
}
...
...
@@ -567,7 +581,7 @@ server <- function(input, output, session){
## Carrying capacity
output
$
carrying_capacity_info
<-
renderText
({
if
(
input
$
carrying_cap_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
carrying_cap_input_type
==
"
e
li
_exp
"
){
if
(
!
(
is.null
(
param
$
carrying_cap_eli_result
))){
info
<-
round
(
param
$
carrying_cap_eli_result
$
mean
)
}
else
{
info
<-
NA
}
...
...
@@ -583,11 +597,11 @@ server <- function(input, output, session){
output
$
pop_trend_type_info
<-
renderText
({
paste0
(
"Type de Tendance de pop : "
,
input
$
pop_growth_input_type
)})
output
$
pop_growth_mean_info
<-
renderText
({
if
(
input
$
pop_growth_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
pop_growth_input_type
==
"
e
li
_exp
"
){
if
(
!
(
is.null
(
param
$
pop_growth_eli_result
))){
info
<-
round
(
param
$
pop_growth_eli_result
$
mean
,
2
)
}
else
{
info
<-
NA
}
}
else
if
(
input
$
pop_growth_input_type
==
"
T
end
ance locale ou rgionale
"
){
}
else
if
(
input
$
pop_growth_input_type
==
"
tr
end"
){
if
(
input
$
pop_trend
==
"Croissance"
)
{
if
(
input
$
pop_trend_strength
==
"Faible"
)
{
info
<-
1.01
...
...
@@ -614,11 +628,11 @@ server <- function(input, output, session){
})
output
$
pop_growth_se_info
<-
renderText
({
if
(
input
$
pop_growth_input_type
==
"
E
li
citation d'expert
"
){
if
(
input
$
pop_growth_input_type
==
"
e
li
_exp
"
){
if
(
!
(
is.null
(
param
$
pop_growth_eli_result
))){
info
<-
round
(
param
$
pop_growth_eli_result
$
SE
,
2
)
}
else
{
info
<-
NA
}
}
else
if
(
input
$
pop_growth_input_type
==
"
T
end
ance locale ou rgionale
"
)
{
}
else
if
(
input
$
pop_growth_input_type
==
"
tr
end"
)
{
info
<-
0.03
}
else
{
...
...
This diff is collapsed.
Click to expand it.
inst/ShinyApp/ui.R
+
6
−
4
View file @
7551911b
...
...
@@ -166,7 +166,7 @@ ui <- fluidPage(
# Input type
radioButtons
(
inputId
=
"fatalities_input_type"
,
label
=
h4
(
"Type de saisie"
),
choices
=
c
(
"Valeurs"
,
"Elicitation d'expert"
)),
choices
=
c
(
"Valeurs"
=
"val"
,
"Elicitation d'expert"
=
"eli_exp"
)),
# Values
numericInput
(
inputId
=
"fatalities_mean"
,
...
...
@@ -223,7 +223,7 @@ ui <- fluidPage(
radioButtons
(
inputId
=
"pop_size_input_type"
,
label
=
h4
(
"Type de saisie"
),
choices
=
c
(
"Valeurs"
,
"Elicitation d'expert"
)),
choices
=
c
(
"Valeurs"
=
"val"
,
"Elicitation d'expert"
=
"eli_exp"
)),
numericInput
(
inputId
=
"pop_size_mean"
,
label
=
"Moyenne de la taille de la population"
,
...
...
@@ -259,7 +259,9 @@ ui <- fluidPage(
radioButtons
(
inputId
=
"pop_growth_input_type"
,
label
=
h4
(
"Type de saisie"
),
choices
=
c
(
"Taux de croissance"
,
"Elicitation d'expert"
,
"Tendance locale ou rgionale"
)),
choices
=
c
(
"Taux de croissance"
=
"val"
,
"Elicitation d'expert"
=
"eli_exp"
,
"Tendance locale ou rgionale"
=
"trend"
)),
numericInput
(
inputId
=
"pop_growth_mean"
,
label
=
"Moyenne de la croissance de la population"
,
...
...
@@ -305,7 +307,7 @@ ui <- fluidPage(
radioButtons
(
inputId
=
"carrying_cap_input_type"
,
label
=
h4
(
"Type de saisie"
),
choices
=
c
(
"Valeurs"
,
"Elicitation d'expert"
)),
choices
=
c
(
"Valeurs"
=
"val"
,
"Elicitation d'expert"
=
"eli_exp"
)),
numericInput
(
inputId
=
"carrying_capacity"
,
label
=
"Capacit de charge"
,
...
...
This diff is collapsed.
Click to expand it.
run_analysis.R
+
31
−
11
View file @
7551911b
...
...
@@ -64,9 +64,11 @@ lambda( build_Leslie(s = s_calibrated, f = f_calibrated) )
pop_size_mean
=
200
pop_growth_mean
=
1.1
fatal_constant
=
"M"
#pop_size_mean = 200
#pop_growth_mean = 1.1
#fatal_constant = "M"
#cumulated_impacts = FALSE
pop_size_type
=
"Ntotal"
carrying_capacity
=
500
...
...
@@ -74,16 +76,34 @@ carrying_capacity = 500
##==============================================================================
## Analyses (simulations) ==
##==============================================================================
run0
<-
run_simul
(
nsim
,
cumulated_impacts
,
fatalities_mean
,
fatalities_se
,
onset_time
,
pop_size_mean
,
pop_size_se
,
pop_size_type
,
pop_growth_mean
,
pop_growth_se
,
survivals
=
s_calibrated
,
fecundities
=
f_calibrated
,
carrying_capacity
=
carrying_capacity
,
theta
=
theta
,
rMAX_species
=
rMAX_species
,
model_demo
,
time_horzion
,
coeff_var_environ
,
fatal_constant
)
run0
<-
run_simul
(
nsim
=
nsim
,
cumulated_impacts
=
cumulated_impacts
,
fatalities_mean
=
fatalities_mean
,
fatalities_se
=
fatalities_se
,
onset_time
=
onset_time
,
pop_size_mean
=
pop_size_mean
,
pop_size_se
=
pop_size_se
,
pop_size_type
=
pop_size_type
,
pop_growth_mean
=
pop_growth_mean
,
pop_growth_se
=
pop_growth_se
,
survivals
=
s_calibrated
,
fecundities
=
f_calibrated
,
carrying_capacity
=
carrying_capacity
,
theta
=
theta
,
rMAX_species
=
rMAX_species
,
model_demo
=
NULL
,
time_horzion
=
time_horzion
,
coeff_var_environ
=
coeff_var_environ
,
fatal_constant
=
fatal_constant
)
#####################################################
names
(
run0
)
...
...
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