Build a stages table
stages_table.Rd
A stages table has variables in rows and stages in columns. These tables enable tracking of variables across the different stages of rebound.
Usage
stages_table(
.analysis_data,
include_description_column = FALSE,
include_tilde_stage = TRUE,
add_units = TRUE,
escape_latex = TRUE,
visibility_mask = ReboundTools::stages_table_visibility_mask,
vars = ReboundTools::key_analysis_vars,
latex_vars = ReboundTools::latex_key_analysis_vars,
stages = ReboundTools::rebound_stages,
latex_stages = ReboundTools::latex_rebound_stages,
case = ReboundTools::eeu_base_params$case,
service_unit = ReboundTools::eeu_base_params$service_unit,
energy_engr_unit = ReboundTools::eeu_base_params$energy_engr_unit,
tilde_stage = ReboundTools::rebound_stages$tilde,
...,
visible = "Visible",
description = "description",
var_name = "var_name",
latex_var_name = "latex_var_name",
.var = ".var",
.stage = ".stage",
.var_stage = ".var_stage",
.value = ".value",
.name = ".name",
.unit_col = ".unit_col",
orig = ReboundTools::rebound_stages$orig,
star = ReboundTools::rebound_stages$star,
hat = ReboundTools::rebound_stages$hat,
bar = ReboundTools::rebound_stages$bar,
tilde = ReboundTools::rebound_stages$tilde
)
Arguments
- .analysis_data
A data frame, usually the result of calling
rebound_analysis()
.- include_description_column
A boolean that tells whether to include a description column on the left.
- include_tilde_stage
A boolean that tells whether to include the tilde column, which is identical to the bar column.
- add_units
When
TRUE
(the default), adds a unit specification to variable names in the table.- escape_latex
When
TRUE
(the default), return LaTeX-compatible versions of strings.- visibility_mask
A data frame that tells which data are visible in the
stages_table()
. Default is stages_table_visibility_mask, a value that shows variables before and after changes only. To see all variables, set toNULL
. Modify stages_table_visibility_mask as needed.- vars
A list of variables for rows of the table. Default is key_analysis_vars. Variable order is preserved in the table.
- latex_vars
See
ReboundTools::latex_key_analysis_vars
. SetNULL
to prevent conversion to LaTeX variable names.- stages
A list of stages for columns of the table. Default is rebound_stages. Stage order is preserved in the table.
- latex_stages
See latex_rebound_stages. Set
NULL
to prevent conversion to LaTeX stage names.- case
See eeu_base_params.
- service_unit, energy_engr_unit
- tilde_stage
Used internally to identify the tilde column. Default is rebound_stages
$tilde
.- ...
Arguments passed to
xtable::xtable()
, possiblylabel
,caption
,digits
, etc.- visible
The name of a column in the stages_table_visibility_mask data frame.
- description, var_name, latex_var_name
Names of columns in the
latex_vars
data frame.- .var, .stage, .var_stage, .value, .name, .unit_col
Column names used internally.
- orig, star, hat, bar, tilde
Rebound stages. See rebound_stages.
Examples
load_eeu_data() %>%
rebound_analysis() %>%
stages_table()
#> % latex table generated in R 4.4.2 by xtable 1.8-4 package
#> % Mon Feb 3 20:59:04 2025
#> \begin{table}[ht]
#> \centering
#> \begin{tabular}{rllrrrrr}
#> \hline
#> & Case & & Original (\$$\backslash$circ\$) & After empl (\$*\$) & After sub (\$$\backslash$wedge\$) & After inc (\$-\$) & After macro (\$$\backslash$sim\$) \\
#> \hline
#> 1 & Car & \$$\backslash$dot\{M\}\$ [$\backslash$\$/yr] & 27401.28 & & & & \\
#> 2 & Car & \$p\_E\$ [$\backslash$\$/MJ] & 0.02 & & & & \\
#> 3 & Car & \$t\_\{life\}\$ [yr] & 14.00 & 14.00 & & & \\
#> 4 & Car & \$\{$\backslash$tau\}\_$\backslash$alpha\$ [--] & 1.20 & 1.20 & & & \\
#> 5 & Car & \$\{$\backslash$tau\}\_$\backslash$omega\$ [--] & 0.80 & 0.80 & & & \\
#> 6 & Car & \$$\backslash$eta\$ [mile/gal] & 25.00 & 42.00 & & & \\
#> 7 & Car & \$$\backslash$eta\$ [mile/MJ] & 0.20 & 0.33 & & & \\
#> 8 & Car & \$p\_s\$ [$\backslash$\$/mile] & 0.09 & 0.05 & & & \\
#> 9 & Car & \$$\backslash$dot\{E\}\_\{emb\}\$ [MJ/yr] & 2428.57 & 2857.14 & & & \\
#> 10 & Car & \$$\backslash$dot\{C\}\_\{cap\}\$ [$\backslash$\$/yr] & 2015.44 & 1965.96 & & & \\
#> 11 & Car & \$\{$\backslash$tau\}\_\{$\backslash$alpha\}$\backslash$dot\{C\}\_\{cap\}\$ [$\backslash$\$/yr] & 2425.11 & 2365.58 & & & \\
#> 12 & Car & \$$\backslash$dot\{C\}\_\{O$\backslash$!M\}\$ [$\backslash$\$/yr] & 2861.13 & 2774.67 & & & \\
#> 13 & Car & \$C\_d\$ [$\backslash$\$] & 100.00 & 101.00 & & & \\
#> 14 & Car & \$$\backslash$dot\{C\}\_d\$ [$\backslash$\$/yr] & 7.14 & 7.21 & & & \\
#> 15 & Car & \$\{$\backslash$tau\}\_\{$\backslash$omega\}$\backslash$dot\{C\}\_d\$ [$\backslash$\$/yr] & 5.68 & 5.74 & & & \\
#> 16 & Car & \$$\backslash$dot\{C\}\_\{O$\backslash$!M$\backslash$!d\}\$ [$\backslash$\$/yr] & 2866.82 & 2780.41 & & & \\
#> 17 & Car & \$$\backslash$dot\{E\}\_s\$ [MJ/yr] & 73060.68 & 43488.50 & 44466.06 & 45840.63 & \\
#> 18 & Car & \$$\backslash$dot\{C\}\_s\$ [$\backslash$\$/yr] & 1275.17 & 759.03 & 776.09 & 800.08 & \\
#> 19 & Car & \$$\backslash$dot\{N\}\$ [$\backslash$\$/yr] & 0.00 & 662.09 & 667.34 & 0.00 & \\
#> 20 & Car & \$$\backslash$dot\{q\}\_s\$ [mile/yr] & & 14425.00 & 14749.25 & 15205.19 & \\
#> 21 & Car & \$$\backslash$dot\{C\}\_g\$ [$\backslash$\$/yr] & & 20834.18 & 20811.86 & 21455.21 & \\
#> 22 & Lamp & \$$\backslash$dot\{M\}\$ [$\backslash$\$/yr] & 27401.28 & & & & \\
#> 23 & Lamp & \$p\_E\$ [$\backslash$\$/MJ] & 0.04 & & & & \\
#> 24 & Lamp & \$t\_\{life\}\$ [yr] & 1.80 & 10.00 & & & \\
#> 25 & Lamp & \$\{$\backslash$tau\}\_$\backslash$alpha\$ [--] & 1.01 & 1.14 & & & \\
#> 26 & Lamp & \$\{$\backslash$tau\}\_$\backslash$omega\$ [--] & 0.96 & 0.85 & & & \\
#> 27 & Lamp & \$$\backslash$eta\$ [lm-hr/W-hr] & 8.83 & 81.80 & & & \\
#> 28 & Lamp & \$$\backslash$eta\$ [lm-hr/MJ] & 2453.70 & 22722.22 & & & \\
#> 29 & Lamp & \$p\_s\$ [$\backslash$\$/lm-hr] & 0.00 & 0.00 & & & \\
#> 30 & Lamp & \$$\backslash$dot\{E\}\_\{emb\}\$ [MJ/yr] & 1.22 & 0.65 & & & \\
#> 31 & Lamp & \$$\backslash$dot\{C\}\_\{cap\}\$ [$\backslash$\$/yr] & 1.04 & 0.12 & & & \\
#> 32 & Lamp & \$\{$\backslash$tau\}\_\{$\backslash$alpha\}$\backslash$dot\{C\}\_\{cap\}\$ [$\backslash$\$/yr] & 1.06 & 0.14 & & & \\
#> 33 & Lamp & \$$\backslash$dot\{C\}\_\{O$\backslash$!M\}\$ [$\backslash$\$/yr] & 0.00 & 0.00 & & & \\
#> 34 & Lamp & \$C\_d\$ [$\backslash$\$] & 0.00 & 0.00 & & & \\
#> 35 & Lamp & \$$\backslash$dot\{C\}\_d\$ [$\backslash$\$/yr] & 0.00 & 0.00 & & & \\
#> 36 & Lamp & \$\{$\backslash$tau\}\_\{$\backslash$omega\}$\backslash$dot\{C\}\_d\$ [$\backslash$\$/yr] & 0.00 & 0.00 & & & \\
#> 37 & Lamp & \$$\backslash$dot\{C\}\_\{O$\backslash$!M$\backslash$!d\}\$ [$\backslash$\$/yr] & 0.00 & 0.00 & & & \\
#> 38 & Lamp & \$$\backslash$dot\{E\}\_s\$ [MJ/yr] & 236.52 & 25.54 & 62.18 & 62.20 & \\
#> 39 & Lamp & \$$\backslash$dot\{C\}\_s\$ [$\backslash$\$/yr] & 8.90 & 0.96 & 2.34 & 2.34 & \\
#> 40 & Lamp & \$$\backslash$dot\{N\}\$ [$\backslash$\$/yr] & 0.00 & 8.86 & 11.85 & 0.00 & \\
#> 41 & Lamp & \$$\backslash$dot\{q\}\_s\$ [lm-hr/yr] & & 580350.00 & 1412809.74 & 1413421.03 & \\
#> 42 & Lamp & \$$\backslash$dot\{C\}\_g\$ [$\backslash$\$/yr] & & 27391.32 & 27386.95 & 27398.80 & \\
#> 43 & Car, r = 0 & \$$\backslash$dot\{M\}\$ [$\backslash$\$/yr] & 27401.28 & & & & \\
#> 44 & Car, r = 0 & \$p\_E\$ [$\backslash$\$/MJ] & 0.02 & & & & \\
#> 45 & Car, r = 0 & \$t\_\{life\}\$ [yr] & 14.00 & 14.00 & & & \\
#> 46 & Car, r = 0 & \$\{$\backslash$tau\}\_$\backslash$alpha\$ [--] & 1.00 & 1.00 & & & \\
#> 47 & Car, r = 0 & \$\{$\backslash$tau\}\_$\backslash$omega\$ [--] & 1.00 & 1.00 & & & \\
#> 48 & Car, r = 0 & \$$\backslash$eta\$ [mile/gal] & 25.00 & 42.00 & & & \\
#> 49 & Car, r = 0 & \$$\backslash$eta\$ [mile/MJ] & 0.20 & 0.33 & & & \\
#> 50 & Car, r = 0 & \$p\_s\$ [$\backslash$\$/mile] & 0.09 & 0.05 & & & \\
#> 51 & Car, r = 0 & \$$\backslash$dot\{E\}\_\{emb\}\$ [MJ/yr] & 2428.57 & 2857.14 & & & \\
#> 52 & Car, r = 0 & \$$\backslash$dot\{C\}\_\{cap\}\$ [$\backslash$\$/yr] & 2015.44 & 1965.96 & & & \\
#> 53 & Car, r = 0 & \$\{$\backslash$tau\}\_\{$\backslash$alpha\}$\backslash$dot\{C\}\_\{cap\}\$ [$\backslash$\$/yr] & 2015.44 & 1965.96 & & & \\
#> 54 & Car, r = 0 & \$$\backslash$dot\{C\}\_\{O$\backslash$!M\}\$ [$\backslash$\$/yr] & 2861.13 & 2774.67 & & & \\
#> 55 & Car, r = 0 & \$C\_d\$ [$\backslash$\$] & 100.00 & 101.00 & & & \\
#> 56 & Car, r = 0 & \$$\backslash$dot\{C\}\_d\$ [$\backslash$\$/yr] & 7.14 & 7.21 & & & \\
#> 57 & Car, r = 0 & \$\{$\backslash$tau\}\_\{$\backslash$omega\}$\backslash$dot\{C\}\_d\$ [$\backslash$\$/yr] & 7.14 & 7.21 & & & \\
#> 58 & Car, r = 0 & \$$\backslash$dot\{C\}\_\{O$\backslash$!M$\backslash$!d\}\$ [$\backslash$\$/yr] & 2868.28 & 2781.88 & & & \\
#> 59 & Car, r = 0 & \$$\backslash$dot\{E\}\_s\$ [MJ/yr] & 73060.68 & 43488.50 & 44490.25 & 45819.94 & \\
#> 60 & Car, r = 0 & \$$\backslash$dot\{C\}\_s\$ [$\backslash$\$/yr] & 1275.17 & 759.03 & 776.51 & 799.72 & \\
#> 61 & Car, r = 0 & \$$\backslash$dot\{N\}\$ [$\backslash$\$/yr] & 0.00 & 652.01 & 657.40 & 0.00 & \\
#> 62 & Car, r = 0 & \$$\backslash$dot\{q\}\_s\$ [mile/yr] & & 14425.00 & 14757.28 & 15198.33 & \\
#> 63 & Car, r = 0 & \$$\backslash$dot\{C\}\_g\$ [$\backslash$\$/yr] & & 21242.39 & 21219.52 & 21853.72 & \\
#> \hline
#> \end{tabular}
#> \end{table}