View source: R/graph_functions.R
eta_fu_plots_df | R Documentation |
This function adds a column of ggplot2
graphs to a completed eta_fu tables data frame.
The graphs are stored in a list column named plots
.
eta_fu_plots_df(
.df,
countries,
plots = "Plots",
country = IEATools::iea_cols$country,
year = IEATools::iea_cols$year,
.values = IEATools::template_cols$.values,
machine = IEATools::template_cols$machine,
eu_product = IEATools::template_cols$eu_product,
machine_eu_product = paste0(machine, "_", eu_product)
)
.df |
The completed final-to useful efficiency tables data frame, which contains both eta.fu and phi.u values. |
countries |
The countries for which final-to useful efficiency plots are to be created. |
plots |
The name of the output column containing final-to useful efficiency graphs. Default is "plots". |
country |
See |
year |
See |
.values, machine, eu_product |
See |
machine_eu_product |
The name of a combined |
By default, the completed eta_fu tables data frame is read from a drake
cache.
The data frame is grouped by machine
, and eu_product
and nested prior to making the graphs,
meaning that one final-to useful efficiency graph is constructed for each combination of machine, and eu_product.
A data frame containing a list column of ggplot2
final-to useful efficiency graphs.
# Make a simple data frame with the expected structure.
alloc_table <- tibble::tribble(~Country, ~Year, ~Ef.product, ~Destination,
~.values, ~Machine, ~Eu.product,
"GHA", 1971, "Gasoline", "Transport",
0.5, "Cars", "MD",
"GHA", 1971, "Gasoline", "Transport",
0.5, "Trucks", "MD",
"GHA", 2020, "Gasoline", "Transport",
0.2, "Cars", "MD",
"GHA", 2020, "Gasoline", "Transport",
0.8, "Trucks", "MD",
"ZAF", 1971, "Gasoline", "Transport",
0.5, "Cars", "MD",
"ZAF", 1971, "Gasoline", "Transport",
0.5, "Trucks", "MD",
"ZAF", 2020, "Gasoline", "Transport",
0.3, "Cars", "MD",
"ZAF", 2020, "Gasoline", "Transport",
0.7, "Trucks", "MD")
alloc_plots_df(alloc_table, c("GHA", "ZAF"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.