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
89822c5c
Commit
89822c5c
authored
1 year ago
by
Azadpour, Elmera
Browse files
Options
Downloads
Patches
Plain Diff
drop empty census vars and maps
parent
bd8897fd
No related branches found
No related tags found
1 merge request
!12
Add disaggregated census data/maps
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
2_process.R
+1
-3
1 addition, 3 deletions
2_process.R
3_visualize.R
+0
-44
0 additions, 44 deletions
3_visualize.R
3_visualize/src/plot_utils.R
+3
-4
3 additions, 4 deletions
3_visualize/src/plot_utils.R
with
4 additions
and
51 deletions
2_process.R
+
1
−
3
View file @
89822c5c
...
...
@@ -87,10 +87,8 @@ tar_target(p2_census_acs5sub_age_data,
iteration
=
"list"
),
# income related variables
# S1901_C01_014 = Estimate!!Households!!PERCENT ALLOCATED!!Household income in the past 12 months
# S1901_C01_015 = Estimate!!Households!!PERCENT ALLOCATED!!Family income in the past 12 months
# S1901_C01_016 = Estimate!!Households!!PERCENT ALLOCATED!!Nonfamily income in the past 12 months
tar_target
(
p2_census_acs5sub_income_layers
,
c
(
"S1901_C01_014"
,
"S1901_C01_015"
,
"S1901_C01_016"
)),
c
(
"S1901_C01_014"
)),
tar_target
(
p2_census_acs5sub_income_data
,
get_census_data
(
geography
=
'county'
,
variable
=
p2_census_acs5sub_income_layers
,
states
=
p1_census_states
,
year
=
2022
,
proj
=
p1_proj
,
...
...
This diff is collapsed.
Click to expand it.
3_visualize.R
+
0
−
44
View file @
89822c5c
...
...
@@ -264,50 +264,6 @@ p3_targets <- list(
),
format
=
"file"
),
tar_target
(
# empty map
p3_perc_family_income_map_png
,
plot_census_map
(
census_data
=
p2_census_acs5sub_income_data
[[
2
]],
percent_leg
=
TRUE
,
var
=
'percent'
,
conus_sf
=
p1_conus_sf
,
outfile_path
=
"3_visualize/out/perc_family_income_2022.png"
,
pal
=
"OrRd"
,
leg_title
=
"Percent allocated\family income\nin the past 12 months, 2022"
,
width
=
6
,
height
=
4
,
dpi
=
300
,
counties_outline_col
=
"grey80"
,
conus_outline_col
=
'grey50'
,
bg_col
=
"white"
,
load_font
=
'Source Sans Pro'
,
font_size
=
10
),
format
=
"file"
),
tar_target
(
# empty map
p3_perc_nonfamily_income_map_png
,
plot_census_map
(
census_data
=
p2_census_acs5sub_income_data
[[
3
]],
percent_leg
=
TRUE
,
var
=
'percent'
,
conus_sf
=
p1_conus_sf
,
outfile_path
=
"3_visualize/out/perc_nonfamily_income_2022.png"
,
pal
=
"OrRd"
,
leg_title
=
"Percent allocated\nonfamily income\nin the past 12 months, 2022"
,
width
=
6
,
height
=
4
,
dpi
=
300
,
counties_outline_col
=
"grey80"
,
conus_outline_col
=
'grey50'
,
bg_col
=
"white"
,
load_font
=
'Source Sans Pro'
,
font_size
=
10
),
format
=
"file"
),
# education related map
tar_target
(
p3_tot_18_24_highschool_education_map_png
,
...
...
This diff is collapsed.
Click to expand it.
3_visualize/src/plot_utils.R
+
3
−
4
View file @
89822c5c
...
...
@@ -13,8 +13,7 @@
#' @param bg_col, assign background color for maps
#' @param load_font, assign font name
#' @param percent_leg if else statement where if TRUE, apply 0-100 legend, otherwise retain 0 - max of variable name
plot_census_map
<-
function
(
census_data
,
conus_sf
,
pal
,
leg_title
,
outfile_path
,
width
,
height
,
dpi
,
counties_outline_col
,
conus_outline_col
,
bg_col
,
load_font
,
font_size
,
var
,
percent_leg
){
plot_census_map
<-
function
(
census_data
,
conus_sf
,
pal
,
leg_title
,
outfile_path
,
width
,
height
,
dpi
,
counties_outline_col
,
conus_outline_col
,
bg_col
,
load_font
,
font_size
,
var
,
percent_leg
){
font_legend
<-
load_font
font_add_google
(
font_legend
)
...
...
@@ -40,7 +39,7 @@ plot_census_map <- function(census_data, conus_sf, pal, leg_title, outfile_path,
position
=
"bottom"
,
barwidth
=
20
,
barheight
=
1
)
)
)
if
(
percent_leg
==
FALSE
)
{
census_map
<-
census_map
+
...
...
@@ -64,4 +63,4 @@ plot_census_map <- function(census_data, conus_sf, pal, leg_title, outfile_path,
ggsave
(
outfile_path
,
census_map
,
width
=
width
,
height
=
height
,
dpi
=
dpi
,
bg
=
bg_col
)
return
(
outfile_path
)
}
}
\ No newline at end of file
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