Damage vector for life-cycle analysis: Difference between revisions
Jump to navigation
Jump to search
(→Formula: rewritten. Uses ovaMatrixProduct from OpasnetUtils/Drafts) |
(→Formula: old code removed) |
||
Line 56: | Line 56: | ||
library(OpasnetUtils) | library(OpasnetUtils) | ||
library(ggplot2) | library(ggplot2) | ||
library(reshape2) | library(reshape2) | ||
Line 62: | Line 61: | ||
objects.latest("Op_en6007", code_name = "answer") # [[OpasnetUtils/Drafts]]. We need ovaMatrixProduct. | objects.latest("Op_en6007", code_name = "answer") # [[OpasnetUtils/Drafts]]. We need ovaMatrixProduct. | ||
show_bins <- 10 # How many different direct inputs to show? | show_bins <- 10 # How many different direct inputs to show? | ||
Line 81: | Line 79: | ||
cat("Primary prosesses related to a cup of coffee (in Euro)\n") | cat("Primary prosesses related to a cup of coffee (in Euro)\n") | ||
oprint(activity) | |||
# Combine the direct requirements of a coffee cup with a full vector of requirements and fill empty cells with 0. | # Combine the direct requirements of a coffee cup with a full vector of requirements and fill empty cells with 0. | ||
Line 100: | Line 98: | ||
normalisation$Obs <- NULL | normalisation$Obs <- NULL | ||
head(normalisation) | oprint(head(normalisation)) | ||
normalisation <- Ovariable("normalisation", data = normalisation) | normalisation <- Ovariable("normalisation", data = normalisation) | ||
Line 110: | Line 108: | ||
activity <- EvalOutput(activity, N = 1) | activity <- EvalOutput(activity, N = 1) | ||
normalisation <- EvalOutput(normalisation, N = 1) | normalisation <- EvalOutput(normalisation, N = 1) | ||
#############################33 | #############################33 | ||
impactsPerDollar2 <- impactsPerDollar * activity # Multiply data matrix with activities. | impactsPerDollar2 <- impactsPerDollar * activity # Multiply data matrix with activities. | ||
head(impactsPerDollar@output) | oprint(head(impactsPerDollar@output)) | ||
head(damagesPerImpact@output) | oprint(head(damagesPerImpact@output)) | ||
out <- ovaMatrixProduct( | out <- ovaMatrixProduct( | ||
Line 164: | Line 123: | ||
) # Do a matrix multiplication | ) # Do a matrix multiplication | ||
out <- out / normalisation * 365 # Normalise and scale to daily values. | |||
# | |||
# Merge all but show_bins largest bins to 'Other'. | # Merge all but show_bins largest bins to 'Other'. | ||
Line 185: | Line 137: | ||
"Other" | "Other" | ||
) | ) | ||
# Plot results on a bar graph. | # Plot results on a bar graph. | ||
Line 201: | Line 142: | ||
cat("Effects smaller than or equal to ", limit / sum(sums$Freq) * 100, " % of the total effect are not shown.\n") | cat("Effects smaller than or equal to ", limit / sum(sums$Freq) * 100, " % of the total effect are not shown.\n") | ||
ggplot(out@output, aes(x = Damage, weight = Result, fill = Purchasing_sector)) + geom_bar() + | |||
ggplot( | |||
theme_grey(base_size = 18) + | theme_grey(base_size = 18) + | ||
theme(axis.text.x = element_text(angle = 45)) + | theme(axis.text.x = element_text(angle = 45)) + |
Revision as of 17:16, 27 December 2013
Moderator:Nobody (see all) Click here to sign up. |
This page is a stub. You may improve it into a full page. |
Upload data
|
Question
What are the damages per unit purchased commodity using a life-cycle assessment?
Answer
Rationale
Dependencies
Data
Obs | Unique_categories | Human health | Ecosystem quality | Climate change | Resources | Water consumption |
---|---|---|---|---|---|---|
1 | Carcinogens | 0.0000028 | 0 | 0 | 0 | 0 |
2 | Non-carcinogens | 0.0000028 | 0 | 0 | 0 | 0 |
3 | Respiratory inorganics | 0.0007 | 0 | 0 | 0 | 0 |
4 | Ionizing radiation | 0.00000000021 | 0 | 0 | 0 | 0 |
5 | Ozone layer depletion | 0.00105 | 0 | 0 | 0 | 0 |
6 | Respiratory organics | 0.00000213 | 0 | 0 | 0 | 0 |
7 | Aquatic ecotoxicity | 0 | 0.0000502 | 0 | 0 | 0 |
8 | Terrestrial ecotoxicity | 0 | 0.00791 | 0 | 0 | 0 |
9 | Terrestrial acidification/nutrification | 0 | 1.04 | 0 | 0 | 0 |
10 | Land occupation | 0 | 1.09 | 0 | 0 | 0 |
11 | Aquatic acidification | 0 | 0 | 0 | 0 | 0 |
12 | Aquatic eutrophication | 0 | 0 | 0 | 0 | 0 |
13 | Global warming | 0 | 0 | 1 | 0 | 0 |
14 | Non-renewable energy | 0 | 0 | 0 | 1 | 0 |
15 | Mineral extraction | 0 | 0 | 0 | 1 | 0 |
16 | Water withdrawal | 0 | 0 | 0 | 0 | 0 |
17 | Water consumption | 0 | 0 | 0 | 0 | 1 |
Example of coffee cup
Obs | Purchasing_sector | Result |
---|---|---|
1 | 31131A - Sugar cane mills and refining | 0.1 |
2 | 112120 - Dairy cattle and milk production | 0.2 |
3 | 311820 - Cookie, cracker, and pasta manufacturing | 0.5 |
4 | 311920 - Coffee and tea manufacturing | 0.2 |
5 | 221100 - Electric power generation, transmission, and distribution | 0.1 |
6 | 322299 - All other converted paper product manufacturing | 0.04 |
7 | 335210 - Small electrical appliance manufacturing | 0 |
8 | 335221 - Household cooking appliance manufacturing | 0.01 |
Formula
See also
Keywords
References
Related files
<mfanonymousfilelist></mfanonymousfilelist>