source('3_visualize/src/plot_utils.R') # For case studies approach: select one demographic characteristic (hispanic/latino), p3_targets <- list( # desktop maps ------------------------------------------------------------ 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 = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), tar_target( p3_perc_household_income_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\nin the past 12 months, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), 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 = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), 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 = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), # Household related maps tar_target( p3_total_households_png, plot_census_map( census_data = p2_census_acs5sub_household_data[[1]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/tot_households_2022.png", leg_title = "Total households, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), tar_target( p3_female_households_png, plot_census_map( census_data = p2_census_acs5sub_household_data[[2]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/tot_female_households_2022.png", leg_title = "Total female households, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), tar_target( p3_median_rent_png, plot_census_map( census_data = p2_census_acs5sub_household_data[[3]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/median_rent_2022.png", leg_title = "Median gross rent, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), # median income by race maps tar_target( p3_med_income_white_png, plot_census_map( census_data = p2_census_acs5sub_income_by_race_data[[1]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/med_income_census_white_2022.png", leg_title = "Median Household Income in the Past 12 Months\n(in 2022 Inflation-Adjusted Dollars),\nWhite Householder", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), tar_target( p3_med_income_black_png, plot_census_map( census_data = p2_census_acs5sub_income_by_race_data[[2]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/med_income_census_black_2022.png", leg_title = "Median Household Income in the Past 12 Months\n(in 2022 Inflation-Adjusted Dollars),\nBlack or African American Householder", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), tar_target( p3_med_income_american_indian_png, plot_census_map( census_data = p2_census_acs5sub_income_by_race_data[[3]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/med_income_census_american_indian_2022.png", leg_title = "Median Household Income in the Past 12 Months\n(in 2022 Inflation-Adjusted Dollars),\nAmerican Indian and Alaska Native Householder", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), tar_target( p3_med_income_asian_png, plot_census_map( census_data = p2_census_acs5sub_income_by_race_data[[4]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/med_income_census_asian_2022.png", leg_title = "Median Household Income in the Past 12 Months\n(in 2022 Inflation-Adjusted Dollars),\nAsian Householder", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), tar_target( p3_med_income_hawaiian_png, plot_census_map( census_data = p2_census_acs5sub_income_by_race_data[[5]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/med_income_census_hawaiian_2022.png", leg_title = "Median Household Income in the Past 12 Months\n(in 2022 Inflation-Adjusted Dollars),\nNative Hawaiian and\n Other Pacific Islander Householder", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), tar_target( p3_med_income_hispanic_png, plot_census_map( census_data = p2_census_acs5sub_income_by_race_data[[6]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/med_income_census_hispanic_2022.png", leg_title = "Median Household Income in the Past 12 Months\n(in 2022 Inflation-Adjusted Dollars),\nHispanic or Latino Householder", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), # disability maps tar_target( p3_perc_disable_png, plot_census_map( census_data = p2_census_acs5sub_disability_data[[1]], percent_leg = TRUE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/perc_disable_census_2022.png", leg_title = "Percent disable, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), tar_target( p3_total_disable_png, plot_census_map( census_data = p2_census_acs5sub_disability_data[[2]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/tot_disable_census_2022.png", leg_title = "Total disable, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_desktop, height = p0_viz_config_df$height_desktop, font_size = p0_viz_config_df$font_size_desktop, barwidth = 20, barheight = 1, mobile = FALSE ), format = "file" ), # mobile maps ------------------------------------------------------------- tar_target( p3_med_income_mobile_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_mobile.png", leg_title = "Median household income, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_mobile, height = p0_viz_config_df$height_mobile, font_size = p0_viz_config_df$font_size_mobile, barwidth = 20, barheight = 1, mobile = TRUE ), format = "file" ), tar_target( p3_perc_household_income_mobile_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_mobile.png", leg_title = "Percent allocated household income\nin the past 12 months, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_mobile, height = p0_viz_config_df$height_mobile, font_size = p0_viz_config_df$font_size_mobile, barwidth = 20, barheight = 1, mobile = TRUE ), format = "file" ), tar_target( p3_tot_latino_mobile_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_mobile.png", leg_title = "Total Latino, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_mobile, height = p0_viz_config_df$height_mobile, font_size = p0_viz_config_df$font_size_mobile, barwidth = 20, barheight = 1, mobile = TRUE ), format = "file" ), tar_target( p3_perc_latino_mobile_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_mobile.png", leg_title = "Percent Latino, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_mobile, height = p0_viz_config_df$height_mobile, font_size = p0_viz_config_df$font_size_mobile, barwidth = 20, barheight = 1, mobile = TRUE ), format = "file" ), tar_target( p3_total_households_mobile_png, plot_census_map( census_data = p2_census_acs5sub_household_data[[1]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/tot_households_2022_mobile.png", leg_title = "Total households, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_mobile, height = p0_viz_config_df$height_mobile, font_size = p0_viz_config_df$font_size_mobile, barwidth = 20, barheight = 1, mobile = TRUE ), format = "file" ), tar_target( p3_female_households_mobile_png, plot_census_map( census_data = p2_census_acs5sub_household_data[[2]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/tot_female_households_2022_mobile.png", leg_title = "Total female households, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_mobile, height = p0_viz_config_df$height_mobile, font_size = p0_viz_config_df$font_size_mobile, barwidth = 20, barheight = 1, mobile = TRUE ), format = "file" ), tar_target( p3_median_rent_mobile_png, plot_census_map( census_data = p2_census_acs5sub_household_data[[3]], percent_leg = FALSE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/median_rent_2022_mobile.png", leg_title = "Median gross rent, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$socioeconomic_status, width = p0_viz_config_df$width_mobile, height = p0_viz_config_df$height_mobile, font_size = p0_viz_config_df$font_size_mobile, barwidth = 20, barheight = 1, mobile = TRUE ), format = "file" ), tar_target( p3_disable_mobile_png, plot_census_map( census_data = p2_census_acs5sub_disability_data[[1]], percent_leg = TRUE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/perc_disable_2022_mobile.png", leg_title = "Total disable, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$demographic_characteristics, width = p0_viz_config_df$width_mobile, height = p0_viz_config_df$height_mobile, font_size = p0_viz_config_df$font_size_mobile, barwidth = 20, barheight = 1, mobile = TRUE ), format = "file" ) )