ejam2excel() takes the output of something like ejamit() and creates a spreadsheet with an overall summary tab, a site by site table tab, as well as other tabs such as map, plot, notes, etc.
Usage
ejam2excel(
  ejamitout,
  fname = NULL,
  save_now = TRUE,
  overwrite = TRUE,
  launchexcel = FALSE,
  interactive_console = TRUE,
  ok2plot = TRUE,
  in.testing = FALSE,
  in.analysis_title = "EJAM analysis",
  react.v1_summary_plot = NULL,
  radius_or_buffer_in_miles = NULL,
  buffer_desc = NULL,
  radius_or_buffer_description =
    "Miles radius of circular buffer (or distance used if buffering around polygons)",
  hyperlink_colnames = "ECHO Report",
  site_method = "",
  mapadd = FALSE,
  report_map = NULL,
  community_reportadd = TRUE,
  community_html = NULL,
  shp = NULL,
  ...
)Arguments
- ejamitout
 output of
ejamit()- fname
 optional name or full path and name of file to save locally, like "out.xlsx"
- save_now
 optional logical, whether to save as a .xlsx file locally or just return workbook object that can later be written to .xlsx file using
openxlsx::saveWorkbook()- overwrite
 optional logical, passed to
openxlsx::saveWorkbook()- launchexcel
 optional logical, passed to
table_xls_format(), whether to launch browser to see spreadsheet immediately- interactive_console
 optional - should set to FALSE when used in code or server. If TRUE, prompts RStudio user interactively asking where to save the downloaded file
- ok2plot
 optional logical, passed to
table_xls_format(), whether safe to try and plot or set FALSE if debugging plot problems- in.testing
 optional logical
- in.analysis_title
 optional title as character string
- react.v1_summary_plot
 optional - a plot object
- radius_or_buffer_in_miles
 optional radius in miles
- buffer_desc
 description of location to use in labels, like "Selected Locations"
- radius_or_buffer_description
 optional text phrase describing places analyzed
- hyperlink_colnames
 optional names of columns with URLs
- site_method
 site selection method, such as SHP, latlon, FIPS, NAICS, FRS, EPA_PROGRAM, SIC, MACT optional site method parameter used to create a more specific title with create_filename. Note
ejamitout$sitetypeis not quite the same as thesite_methodparameter used in building reports. sitetype can be latlon, fips, or shp site_method can be one of these: SHP, latlon, FIPS, NAICS, FRS, EPA_PROGRAM, SIC, MACT- mapadd
 Logical, whether to add a tab with a map of the sites. If report tab is added, though, standalone static map in excel tab is redundant.
- report_map
 the map to use if mapadd = TRUE (re-created if this is omitted/NULL but mapadd is TRUE)
- community_reportadd
 Logical, whether to add a tab with a static copy of the summary report (tables, map, barplot).
- community_html
 the HTML of the summary/community report if available (re-created if this is omitted/NULL but community_reportadd is TRUE)
- shp
 shapefile to create map if not providing it via report_map or community_html parameters
- ...
 optional additional parameters passed to
table_xls_format(), such as heatmap_colnames, heatmap_cuts, heatmap_colors, etc.
Value
returns a workbook object for use by openxlsx::saveWorkbook(wb_out, pathname) or returns just the full path/file name of where it was saved if save_now = TRUE
Examples
# \donttest{
# Add purple to flag indicators at 99th percentile
ejam2excel(testoutput_ejamit_10pts_1miles,
  # View spreadsheet 1st without saving it as a file
  launchexcel = T, save_now = F,
  heatmap_cuts = c(80, 90, 95, 99),
  heatmap_colors  = c("yellow", "orange", "red", "purple"),
  # Apply heatmap to only a few of the ratio columns
  heatmap2_colnames = names_d_ratio_to_state_avg)
#> TRYING TO USE logo_path =  /home/runner/work/_temp/Library/EJAM/report/community_report/ejamhex4.png 
#> mydf seems to be a list of tables such as output from ejamit() so using just the results_bysite table here
#> phantomjs has been installed to /home/runner/bin
#> Error in chooseExcelApp(): No applications (detected) available.
#> Set options('openxlsx.excelApp'), instead.
# }