Skip to contents

Build a rebound results table

Usage

rebound_results_table(
  .analysis_data,
  escape_latex = TRUE,
  include_subtotals = TRUE,
  include_total = TRUE,
  as_percent = TRUE,
  rebound_terms = ReboundTools::rebound_terms,
  latex_rebound_terms = ReboundTools::latex_rebound_terms,
  case = ReboundTools::eeu_base_params$case,
  subtotals = c(ReboundTools::rebound_terms$Re_om, ReboundTools::rebound_terms$Re_d,
    ReboundTools::rebound_terms$Re_empl, ReboundTools::rebound_terms$Re_sub,
    ReboundTools::rebound_terms$Re_inc, ReboundTools::rebound_terms$Re_dir,
    ReboundTools::rebound_terms$Re_indir, ReboundTools::rebound_terms$Re_micro),
  total = ReboundTools::rebound_terms$Re_tot,
  term_name = "Rebound term",
  latex_term_name = "LaTeX rebound term",
  Re_val_colname = "Value [-]",
  perc_Re_val_colname = "Value [%]",
  latex_Re_val_colname = "Value [--]",
  latex_perc_Re_val_colname = "Value [\\%]",
  ...
)

Arguments

.analysis_data

Rebound analysis results. Probably the output of a call to rebound_analysis().

escape_latex

When TRUE (the default), return LaTeX-compatible versions of strings.

include_subtotals

Tells whether to include rebound subtotals by stage and direct/indirect. Default is TRUE.

include_total

Tells whether to include rebound total. Default is TRUE.

as_percent

When TRUE, rebound results are reported as percentages. When FALSE, rebound results are reported as fractions. Default is TRUE.

rebound_terms

See ReboundTools::rebound_terms.

latex_rebound_terms

See ReboundTools::latex_rebound_terms.

case

See ReboundTools::eeu_base_params.

subtotals

The rebound terms that represent subtotals. Default is c(ReboundTools::rebound_terms$Re_empl, ReboundTools::rebound_terms$Re_sub, ReboundTools::rebound_terms$Re_inc, ReboundTools::rebound_terms$Re_dir, ReboundTools::rebound_terms$Re_indir, ReboundTools::rebound_terms$Re_micro).

total

The rebound term that represents total rebound. Default is ReboundTools::rebound_terms$Re_tot.

term_name

The title of the rebound term column. Default is "Rebound term".

latex_term_name

The LaTeX term name column. Default is "LaTeX rebound term".

Re_val_colname

The title of the rebound value column. Default is "Value [--]".

perc_Re_val_colname

The title of the rebound value column when percentages are requested. Default is "Value [%]".

latex_Re_val_colname

The LaTeX rebound value column name. Default is "Value [--]".

latex_perc_Re_val_colname

The LaTeX rebound value column name when percentages are requested. Default is "Value [\%]".

...

Arguments passed to xtable::xtable(), possibly label, caption, digits, etc.

Value

An xtable object suitable for printing.

Examples

load_eeu_data() %>% 
  rebound_analysis() %>% 
  rebound_results_table()
#> % latex table generated in R 4.4.1 by xtable 1.8-4 package
#> % Tue Jul  9 20:10:24 2024
#> \begin{table}[ht]
#> \centering
#> \begin{tabular}{rllr}
#>   \hline
#>  & Case & Rebound term & Value [$\backslash$\%] \\ 
#>   \hline
#> 1 & Car & \$Re\_\{dempl\}\$ & 0.00 \\ 
#>   2 & Car & \$Re\_\{emb\}\$ & 1.45 \\ 
#>   3 & Car & \$Re\_\{cap\}\$ & -9.55 \\ 
#>   4 & Car & \$Re\_\{O$\backslash$!M\}\$ & -0.99 \\ 
#>   5 & Car & \$Re\_d\$ & 0.00 \\ 
#>   6 & Car & \$Re\_\{O$\backslash$!M$\backslash$!d\}\$ & -0.99 \\ 
#>   7 & Car & \$Re\_\{empl\}\$ & 0.46 \\ 
#>   8 & Car & \$Re\_\{dsub\}\$ & 3.31 \\ 
#>   9 & Car & \$Re\_\{isub\}\$ & -0.26 \\ 
#>   10 & Car & \$Re\_\{sub\}\$ & 3.05 \\ 
#>   11 & Car & \$Re\_\{dinc\}\$ & 4.65 \\ 
#>   12 & Car & \$Re\_\{iinc\}\$ & 7.37 \\ 
#>   13 & Car & \$Re\_\{inc\}\$ & 12.02 \\ 
#>   14 & Car & \$Re\_\{micro\}\$ & 15.53 \\ 
#>   15 & Car & \$Re\_\{macro\}\$ & 7.59 \\ 
#>   16 & Car & \$Re\_\{dir\}\$ & 7.95 \\ 
#>   17 & Car & \$Re\_\{indir\}\$ & 15.17 \\ 
#>   18 & Car & \$Re\_\{tot\}\$ & 23.12 \\ 
#>   19 & Lamp & \$Re\_\{dempl\}\$ & 0.00 \\ 
#>   20 & Lamp & \$Re\_\{emb\}\$ & -0.27 \\ 
#>   21 & Lamp & \$Re\_\{cap\}\$ & -0.84 \\ 
#>   22 & Lamp & \$Re\_\{O$\backslash$!M\}\$ & 0.00 \\ 
#>   23 & Lamp & \$Re\_d\$ & 0.00 \\ 
#>   24 & Lamp & \$Re\_\{O$\backslash$!M$\backslash$!d\}\$ & 0.00 \\ 
#>   25 & Lamp & \$Re\_\{empl\}\$ & -0.27 \\ 
#>   26 & Lamp & \$Re\_\{dsub\}\$ & 17.36 \\ 
#>   27 & Lamp & \$Re\_\{isub\}\$ & -7.02 \\ 
#>   28 & Lamp & \$Re\_\{sub\}\$ & 10.35 \\ 
#>   29 & Lamp & \$Re\_\{dinc\}\$ & 0.01 \\ 
#>   30 & Lamp & \$Re\_\{iinc\}\$ & 19.04 \\ 
#>   31 & Lamp & \$Re\_\{inc\}\$ & 19.05 \\ 
#>   32 & Lamp & \$Re\_\{micro\}\$ & 29.12 \\ 
#>   33 & Lamp & \$Re\_\{macro\}\$ & 14.23 \\ 
#>   34 & Lamp & \$Re\_\{dir\}\$ & 17.38 \\ 
#>   35 & Lamp & \$Re\_\{indir\}\$ & 25.98 \\ 
#>   36 & Lamp & \$Re\_\{tot\}\$ & 43.36 \\ 
#>   37 & Car, r = 0 & \$Re\_\{dempl\}\$ & 0.00 \\ 
#>   38 & Car, r = 0 & \$Re\_\{emb\}\$ & 1.45 \\ 
#>   39 & Car, r = 0 & \$Re\_\{cap\}\$ & -7.94 \\ 
#>   40 & Car, r = 0 & \$Re\_\{O$\backslash$!M\}\$ & -0.99 \\ 
#>   41 & Car, r = 0 & \$Re\_d\$ & 0.00 \\ 
#>   42 & Car, r = 0 & \$Re\_\{O$\backslash$!M$\backslash$!d\}\$ & -0.99 \\ 
#>   43 & Car, r = 0 & \$Re\_\{empl\}\$ & 0.46 \\ 
#>   44 & Car, r = 0 & \$Re\_\{dsub\}\$ & 3.39 \\ 
#>   45 & Car, r = 0 & \$Re\_\{isub\}\$ & -0.26 \\ 
#>   46 & Car, r = 0 & \$Re\_\{sub\}\$ & 3.13 \\ 
#>   47 & Car, r = 0 & \$Re\_\{dinc\}\$ & 4.50 \\ 
#>   48 & Car, r = 0 & \$Re\_\{iinc\}\$ & 7.27 \\ 
#>   49 & Car, r = 0 & \$Re\_\{inc\}\$ & 11.77 \\ 
#>   50 & Car, r = 0 & \$Re\_\{micro\}\$ & 15.35 \\ 
#>   51 & Car, r = 0 & \$Re\_\{macro\}\$ & 7.47 \\ 
#>   52 & Car, r = 0 & \$Re\_\{dir\}\$ & 7.88 \\ 
#>   53 & Car, r = 0 & \$Re\_\{indir\}\$ & 14.94 \\ 
#>   54 & Car, r = 0 & \$Re\_\{tot\}\$ & 22.82 \\ 
#>    \hline
#> \end{tabular}
#> \end{table}