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
7b55aa19
Commit
7b55aa19
authored
2 years ago
by
thierrychambert
Browse files
Options
Downloads
Patches
Plain Diff
Debugged issue due to NA results (plots)
parent
8e5e9dfc
Branches
main
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
R/ECDF_impact.R
+1
-1
1 addition, 1 deletion
R/ECDF_impact.R
R/density_impact.R
+5
-5
5 additions, 5 deletions
R/density_impact.R
R/plot_impact.R
+2
-0
2 additions, 0 deletions
R/plot_impact.R
with
8 additions
and
6 deletions
R/ECDF_impact.R
+
1
−
1
View file @
7b55aa19
...
...
@@ -101,7 +101,7 @@ ECDF_impact <- function(N, show_quantile = 0.95, sel_sc = "all", xlims = NULL,
# Add quantile vline
QT
<-
apply
(
-
out
[
TH
,,],
2
,
quantile
,
probs
=
show_quantile
)
QT
<-
apply
(
-
out
[
TH
,,],
2
,
quantile
,
probs
=
show_quantile
,
na.rm
=
TRUE
)
QT
<-
QT
[
-1
]
if
(
sel_sc
!=
"all"
)
QT
<-
QT
[
sel_sc
]
...
...
This diff is collapsed.
Click to expand it.
R/density_impact.R
+
5
−
5
View file @
7b55aa19
...
...
@@ -40,7 +40,7 @@ density_impact <- function(N, show_CI = 0.95, center = "median", sel_sc = "all",
max_y
<-
c
()
for
(
j
in
unique
(
df0
$
scenario
)){
dd
<-
density
(
df0
$
impact
[
df0
$
scenario
==
j
])
dd
<-
density
(
df0
$
impact
[
df0
$
scenario
==
j
]
,
na.rm
=
TRUE
)
max_y
[
j
]
<-
max
(
dd
$
y
)
}
max_y
<-
max
(
max_y
)
...
...
@@ -113,7 +113,7 @@ density_impact <- function(N, show_CI = 0.95, center = "median", sel_sc = "all",
yend
<-
x
<-
c
()
for
(
j
in
unique
(
dat
$
scenario
)){
dd
<-
density
(
dat
$
impact
[
dat
$
scenario
==
j
])
dd
<-
density
(
dat
$
impact
[
dat
$
scenario
==
j
]
,
na.rm
=
TRUE
)
if
(
QT
[
1
]
==
"mode"
){
x
[
j
]
<-
dd
$
x
[
which.max
(
dd
$
y
)]
...
...
@@ -129,7 +129,7 @@ density_impact <- function(N, show_CI = 0.95, center = "median", sel_sc = "all",
}
# Add LCI vlines
LCI
<-
apply
(
-
out
[
TH
,,],
2
,
quantile
,
probs
=
(
1
-
show_CI
)
/
2
)
LCI
<-
apply
(
-
out
[
TH
,,],
2
,
quantile
,
probs
=
(
1
-
show_CI
)
/
2
,
na.rm
=
TRUE
)
LCI
<-
LCI
[
-1
]
yend
<-
get_density
(
dat
=
p
$
data
,
QT
=
LCI
)
$
yend
...
...
@@ -145,7 +145,7 @@ density_impact <- function(N, show_CI = 0.95, center = "median", sel_sc = "all",
# Add UCI vlines
UCI
<-
apply
(
-
out
[
TH
,,],
2
,
quantile
,
probs
=
1
-
(
1
-
show_CI
)
/
2
)
UCI
<-
apply
(
-
out
[
TH
,,],
2
,
quantile
,
probs
=
1
-
(
1
-
show_CI
)
/
2
,
na.rm
=
TRUE
)
UCI
<-
UCI
[
-1
]
yend
<-
get_density
(
dat
=
p
$
data
,
QT
=
UCI
)
$
yend
...
...
@@ -165,7 +165,7 @@ density_impact <- function(N, show_CI = 0.95, center = "median", sel_sc = "all",
xQT
<-
get_density
(
dat
=
p
$
data
,
QT
=
"mode"
)
$
x
yend
<-
get_density
(
dat
=
p
$
data
,
QT
=
"mode"
)
$
yend
}
else
{
xQT
<-
apply
(
-
out
[
TH
,,],
2
,
quantile
,
probs
=
0.5
)
xQT
<-
apply
(
-
out
[
TH
,,],
2
,
quantile
,
probs
=
0.5
,
na.rm
=
TRUE
)
xQT
<-
xQT
[
-1
]
yend
<-
get_density
(
dat
=
p
$
data
,
QT
=
xQT
)
$
yend
if
(
sel_sc
!=
"all"
)
xQT
<-
xQT
[
sel_sc
]
...
...
This diff is collapsed.
Click to expand it.
R/plot_impact.R
+
2
−
0
View file @
7b55aa19
...
...
@@ -46,6 +46,8 @@ plot_impact <- function(N, onset_year = NULL, sel_sc = "all", percent = TRUE, sh
CI
<-
apply
(
out
[,,],
c
(
1
,
3
),
quantile
,
probs
=
c
(
0.5
,
1
-
(
1
-
show_CI
)
/
2
,
(
1
-
show_CI
)
/
2
))
rownames
(
CI
)
<-
c
(
"avg"
,
"lci"
,
"uci"
)
# null scenario
CI
[
"uci"
,,
"sc0"
]
<-
CI
[
"lci"
,,
"sc0"
]
<-
CI
[
"avg"
,,
"sc0"
]
# Build dataframe
if
(
sel_sc
==
"all"
){
...
...
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