Skip to content
Snippets Groups Projects
3_visualize.R 5.65 KiB
Newer Older
source('3_visualize/src/plot_utils.R')
  tar_target(
    p3_med_income_png,
    plot_census_map(
      census_data = p2_perc_census_acs5_layers_sf[[2]],
      percent_leg = FALSE,
      var = 'estimate', 
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/med_income_census_2022.png",
      leg_title = "Median household income, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  tar_target(
    p3_tot_black_png,
    plot_census_map(
      census_data = p2_perc_census_acs5_layers_sf[[3]],
      percent_leg = FALSE,
      var = 'estimate',
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/tot_black_census_2022.png",
      leg_title = "Total Black, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  
  
  tar_target(
    p3_perc_black_png,
    plot_census_map(
      census_data = p2_perc_census_acs5_layers_sf[[3]],
      percent_leg = TRUE,
      var = 'percent',
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/perc_black_census_2022.png",
      leg_title = "Percent Black, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  
  tar_target(
    p3_tot_latino_png,
    plot_census_map(
      census_data = p2_perc_census_acs5_layers_sf[[4]],
      percent_leg = FALSE,
      var = 'estimate',
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/tot_latino_census_2022.png",
      leg_title =  "Total Latino, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  
  tar_target(
    p3_perc_latino_png,
    plot_census_map(
      census_data = p2_perc_census_acs5_layers_sf[[4]],
      percent_leg = TRUE,
      var = 'percent',
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/perc_latino_census_2022.png",
      leg_title = "Percent Latino, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  
  tar_target(
    p3_tot_male_png,
    plot_census_map(
      census_data = p2_perc_census_acs5_layers_sf[[5]],
      percent_leg = FALSE,
      var = 'estimate',
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/tot_male_census_2022.png",
      leg_title =  "Total Male, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  
  tar_target(
    p3_tot_female_png,
    plot_census_map(
      census_data = p2_perc_census_acs5_layers_sf[[6]],
      percent_leg = FALSE,
      var = 'estimate', 
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/tot_female_census_2022.png",
      leg_title =  "Total Female, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  
  #  Disaggregated maps
  # percent age maps 
  tar_target(
    p3_perc_under_18_map_png,
    plot_census_map(
      census_data = p2_census_acs5sub_age_data[[1]],
      percent_leg = TRUE,
      var = 'percent', 
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/perc_pop_under_18_2022.png",
      leg_title =  "Percent of Total Poulation Under 18, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  tar_target(
    p3_perc_18_24_map_png,
    plot_census_map(
      census_data = p2_census_acs5sub_age_data[[2]],
      percent_leg = TRUE,
      var = 'percent', 
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/perc_pop_under_18-24_2022.png",
      leg_title =  "Percent of Total Poulation 18-24 years, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  tar_target(
    p3_perc_15_44_map_png,
    plot_census_map(
      census_data = p2_census_acs5sub_age_data[[3]],
      percent_leg = TRUE,
      var = 'percent', 
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/perc_pop_under_15-44_2022.png",
      leg_title =  "Percent of Total Poulation 15-44 years, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  tar_target(
    p3_perc_60_plus_map_png,
    plot_census_map(
      census_data = p2_census_acs5sub_age_data[[4]],
      percent_leg = TRUE,
      var = 'percent', 
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/perc_pop_under_60_plus_2022.png",
      leg_title =  "Percent of Total Poulation 60 years & plus, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  # percent income maps 
  tar_target(
    p3_perc_household_income_map_png,
    plot_census_map(
      census_data = p2_census_acs5sub_income_data[[1]],
      percent_leg = TRUE,
      var = 'percent', 
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/perc_household_income_2022.png",
      leg_title =  "Percent allocated household income in the past 12 months, 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  # education related map
  tar_target(
    p3_tot_18_24_highschool_education_map_png,
    plot_census_map(
      census_data = p2_census_acs5sub_education_data[[1]],
      percent_leg = FALSE,
      var = 'estimate', 
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/tot_education_18-24_highschool_2022.png",
      leg_title =  "Total population 18-24 years\nhigh school graduate (includes equivalency), 2022",
      viz_config_df = viz_config_df
    ),
    format = "file"
  ),
  tar_target(
    p3_tot_25_plus_highschool_education_map_png,
    plot_census_map(
      census_data = p2_census_acs5sub_education_data[[2]],
      percent_leg = FALSE,
      var = 'estimate', 
      conus_sf = p1_conus_sf, 
      outfile_path = "3_visualize/out/tot_education_25-plus_highschool_2022.png",
      leg_title =  "Total population 25 and older\nhigh school graduate (includes equivalency), 2022",
      viz_config_df = viz_config_df