Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vulnerability-indicators
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
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
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
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Water Mission Area
VizLab
vulnerability-indicators
Commits
fa8146fa
Commit
fa8146fa
authored
1 year ago
by
Azadpour, Elmera
Browse files
Options
Downloads
Patches
Plain Diff
edit processing to use SB data csv
parent
0ce311d0
No related branches found
No related tags found
1 merge request
!12
Add disaggregated census data/maps
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
2_process.R
+10
-9
10 additions, 9 deletions
2_process.R
with
10 additions
and
9 deletions
2_process.R
+
10
−
9
View file @
fa8146fa
...
...
@@ -3,14 +3,15 @@ source('2_process/src/data_utils.R')
p2_targets
<-
list
(
# Confirming raw data matches `p1_unc_stats` from SB
tar_target
(
p2_unc_agg_summary
,
p1_unc_
agg
|>
p1_unc_
stats
|>
group_by
(
dimension
,
determinant
)
|>
summarize
(
across
(
c
(
contains
(
'related'
),
contains
(
'unknown'
),
contains
(
'significant'
)),
contains
(
'significant'
),
contains
(
'direction'
)),
list
(
total
=
~
sum
(
.x
,
na.rm
=
TRUE
))))
|>
mutate
(
evidence_val
=
pos
itively
_related_total
+
neg
atively
_related_total
+
unrelated_total
+
unk
nown
_direction_total
)
mutate
(
evidence_val
=
pos_related_total
+
neg_related_total
+
unrelated_total
+
unk_direction_total
)
),
# Based on metadata:
# Amt of evidence: Small = total_studies < 5; Medium = total_studies 5-9; Large,total_studies = > 9
...
...
@@ -18,22 +19,22 @@ p2_targets <- list(
tar_target
(
p2_top_trend_stats
,
p2_unc_agg_summary
|>
dplyr
::
select
(
dimension
,
determinant
,
#indicator,
positively
_related_total
,
neg
atively
_related_total
,
unrelated_total
,
unknown
_direction_total
)
|>
pos
_related_total
,
neg_related_total
,
unrelated_total
,
unk
_direction_total
)
|>
pivot_longer
(
!
c
(
dimension
,
determinant
))
|>
group_by
(
dimension
,
determinant
)
|>
# for each
indicator
find the maximum % of studies in agreement
# for each
determinant
find the maximum % of studies in agreement
# across the significance categories.
slice_max
(
value
)
|>
rename
(
sig_name
=
name
,
sig_value
=
value
)
),
# Join `p2_unc_agg_summary` to top trends to get percentages of agreement and evidence
tar_target
(
p2_unc_agg_summary_csv
,
tar_target
(
`
p2_unc_agg_summary_csv
`
,
p2_unc_agg_summary
|>
left_join
(
p2_top_trend_stats
)
|>
# level of agreement is the max percent of studies in agreement
dplyr
::
mutate
(
level_agreement
=
100
*
(
sig_value
/
evidence_val
))
|>
readr
::
write_csv
(
'2_process/out/
indicator
_uncertainty.csv'
)
readr
::
write_csv
(
'2_process/out/
determinant
_uncertainty.csv'
)
),
tar_target
(
p2_indicators
,
...
...
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