Skip to contents

Creates a 2 page report on overall results or for one site, with residential population and environmental indicators, and Summary Indexes if needed.

Usage

build_community_report(
  output_df,
  analysis_title = "Report",
  totalpop,
  locationstr,
  include_ejindexes = FALSE,
  in_shiny = FALSE,
  filename = NULL,
  show_ratios_in_report = FALSE,
  extratable_show_ratios_in_report = FALSE,
  extratable_title = "EJScreen environmental and socioeconomic indicators data",
  extratable_list_of_sections = list(`Breakdown by Race/Ethnicity` = names_d_subgroups,
    `Language Spoken at Home` = names_d_language,
    `Language in Limited English Speaking Households` = names_d_languageli,
    `Breakdown by Sex` = c("pctmale", "pctfemale"), Health = names_health, Community =
    names_community[!(names_community %in% c("pctmale", "pctfemale",
    "pctownedunits_dupe"))], Poverty = names_d_extra),
  extratable_hide_missing_rows_for = c(names_d_language, names_health)
)

Arguments

output_df

single row of results table from doaggregate - either results_overall or one row of bysite

analysis_title

title to use in header of report

totalpop

total population included in location(s) analyzed

locationstr

description of the location(s) analyzed

include_ejindexes

whether to build tables for summary indexes and supp. summary indexes

in_shiny

whether the function is being called in or outside of shiny - affects location of header

filename

path to file to save HTML content to; if null, returns as string (used in Shiny app)

show_ratios_in_report

logical, whether to add columns with ratios to US and State overall values, in main table of envt/demog. info.

extratable_show_ratios_in_report

logical, whether to add columns with ratios to US and State overall values, in extra table of demog. subgroups, etc.

extratable_title

Text of overall title of report table, in extra table of demog. subgroups, etc.

extratable_list_of_sections

This defines what extra indicators are shown. It is a named list of vectors, where each name is text phrase that is title of a section of the table, and each vector is the vector of colnames of output_df that are indicators to show in that section, in extra table of demog. subgroups, etc.

extratable_hide_missing_rows_for

only for the indicators named in this vector, leave out rows in table where raw value is NA, as with many of names_d_language, in extra table of demog. subgroups, etc.'

Details

For the same function for use in RStudio, see ejam2report() which relies on build_community_report()

This function gets called by app_server, ejam2report(), and community_report_template.Rmd

See also