Skip to content

Commit

Permalink
Add category labels so that all figs draw
Browse files Browse the repository at this point in the history
  • Loading branch information
qdread committed Jan 7, 2020
1 parent e9d4242 commit 6679289
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
3 changes: 2 additions & 1 deletion analysis.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
# Read, Q. D., et al. 2019. Assessing the environmental impacts of halving food loss and waste along the food supply chain. Science of the Total Environment. #
# #
# Code to reproduce all analyses in manuscript, beginning with cleaned data #
# Last modified by QDR on 06 January 2020 #
# Last modified by QDR on 07 January 2020 #
# Tested with R version 3.6.2 on Windows and Linux #
# Contact: [email protected] #
#################################################################################################################################################################

Expand Down
9 changes: 8 additions & 1 deletion figures.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# Read, Q. D., et al. 2019. Assessing the environmental impacts of halving food loss and waste along the food supply chain. Science of the Total Environment. #
# #
# Code to reproduce all data figures in manuscript (Figures 2, 3, and 4), beginning with output generated by analysis.R #
# Last modified by QDR on 06 January 2020 #
# Last modified by QDR on 07 January 2020 #
# Tested with R version 3.6.2 on Windows and Linux #
# Contact: [email protected] #
#################################################################################################################################################################

Expand All @@ -25,6 +26,12 @@ results_by_commodity_df <- read.csv('output/bestpathway_bycommodity.csv', string
# Figure 2 #
############

category_labels_expression <- list("Eutrophication potential (kg N eq.)",
expression(paste("GHG emissions (kg ", CO[2], " eq.)")),
"Energy use (GJ)",
expression(paste("Land used (", m^2, ")")),
expression(paste("Water used ", (m^3))))

waste_impacts <- base_and_nowaste %>%
mutate(scenario = if_else(rowSums(.[,1:6]) == 0, 'baseline', 'zero_waste')) %>%
select(scenario, impact_category, value) %>%
Expand Down

0 comments on commit 6679289

Please sign in to comment.