source('3_visualize/src/plot_utils.R') # For case studies approach: select one demographic characteristic (hispanic/latino), p3_targets <- list( tar_target( p3_med_income_png_en, plot_census_map( census_data = p2_perc_census_acs5_layers_sf[[2]], lim_vals = c(0, 155000), percent_leg = FALSE, dollar_leg = TRUE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/med_income_census_2022_en.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, low_ramp_col = "#fef1f1" ), format = "file" ), tar_target( p3_perc_latino_png_en, plot_census_map( census_data = p2_perc_census_acs5_layers_sf[[4]], percent_leg = TRUE, dollar_leg = FALSE, lim_vals = c(0, 100), break_vals = c(0, 25, 50, 75, 100), var = 'percent', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/perc_hispanic_census_2022_en.png", leg_title = "Percent Hispanic, 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, low_ramp_col = "#eef0ff" ), format = "file" ), tar_target( p3_avg_household_size_png_en, plot_census_map( census_data = p2_census_acs5sub_household_data[[1]], percent_leg = FALSE, dollar_leg = FALSE, lim_vals = c(1, 5), var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/avg_household_size_2022_en.png", leg_title = "Average household size, 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, low_ramp_col = "#eef0ff" ), format = "file" ), tar_target( p3_median_rent_png_en, plot_census_map( census_data = p2_census_acs5sub_household_data[[2]], percent_leg = FALSE, dollar_leg = TRUE, lim_vals = c(0, 3000), var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/median_rent_2022_en.png", leg_title = "Median gross rent, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$land_tenure, 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, low_ramp_col = "#ebfaf8" ), format = "file" ), tar_target( p3_perc_disable_png_en, plot_census_map( census_data = p2_census_acs5sub_disability_data[[1]], percent_leg = TRUE, dollar_leg = FALSE, lim_vals = c(0, 50), break_vals = c(0, 10, 20, 30, 40, 50), var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/perc_disabled_census_2022_en.png", leg_title = "Percent disabled, 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, low_ramp_col = "#eef0ff" ), format = "file" ), # population density raster plot tar_target( p3_pop_density_plot, plot_raster(in_raster = p2_pop_density_filepath, conus_sf = p2_conus_sf_proj, viz_config_df = p0_viz_config_df, conus_inner = p2_conus_inner, viz_config_pal = p0_viz_config_pal$living_conditions, 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, outfile_path = "3_visualize/out/pop_density_rast_2020_en.png", low_ramp_col = "#E8F4F4"), format = "file"), # impervious surfaces raster plot tar_target( p3_imp_surf_plot, plot_imp_surf_raster(in_raster = p2_imp_surfaces_filepath, conus_sf = p2_conus_sf_proj, viz_config_df = p0_viz_config_df, conus_col = "gray90", conus_inner = p2_conus_inner, viz_config_pal = p0_viz_config_pal$living_conditions, 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, outfile_path = "3_visualize/out/imp_surface_rast_2022_en.png", low_ramp_col = "white" ) ), # Spanish version's of maps ----------------------------------------------- tar_target( p3_med_income_png_es, plot_census_map( census_data = p2_perc_census_acs5_layers_sf[[2]], lim_vals = c(0, 155000), percent_leg = FALSE, dollar_leg = TRUE, var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/med_income_census_2022_es.png", leg_title = "Media de ingresos por hogar, 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, low_ramp_col = "#fef1f1" ), format = "file" ), tar_target( p3_perc_latino_png_es, plot_census_map( census_data = p2_perc_census_acs5_layers_sf[[4]], percent_leg = TRUE, dollar_leg = FALSE, lim_vals = c(0, 100), break_vals = c(0, 25, 50, 75, 100), var = 'percent', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/perc_hispanic_census_2022_es.png", leg_title = "Porcentaje de Hispanos, 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, low_ramp_col = "#eef0ff" ), format = "file" ), tar_target( p3_avg_household_size_png_es, plot_census_map( census_data = p2_census_acs5sub_household_data[[1]], percent_leg = FALSE, dollar_leg = FALSE, lim_vals = c(1, 5), var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/avg_household_size_2022_es.png", leg_title = "TamaƱo promedio de los hogares, 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, low_ramp_col = "#eef0ff" ), format = "file" ), tar_target( p3_median_rent_png_es, plot_census_map( census_data = p2_census_acs5sub_household_data[[2]], percent_leg = FALSE, dollar_leg = TRUE, lim_vals = c(0, 3000), var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/median_rent_2022_es.png", leg_title = "Alquiler bruto medio, 2022", viz_config_df = p0_viz_config_df, viz_config_pal = p0_viz_config_pal$land_tenure, 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, low_ramp_col = "#ebfaf8" ), format = "file" ), tar_target( p3_perc_disable_png_es, plot_census_map( census_data = p2_census_acs5sub_disability_data[[1]], percent_leg = TRUE, dollar_leg = FALSE, lim_vals = c(0, 50), break_vals = c(0, 10, 20, 30, 40, 50), var = 'estimate', conus_sf = p1_conus_sf, outfile_path = "3_visualize/out/perc_disabled_census_2022_es.png", leg_title = "Porcentaje de discapacitados, 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, low_ramp_col = "#eef0ff" ), format = "file" ) )