Damage vector for life-cycle analysis: Difference between revisions
Jump to navigation
Jump to search
(→Formula: graph improved, coffee table added to output) |
(→Formula: normalisation added) |
||
Line 63: | Line 63: | ||
# Take the damage factor table from this page. | # Take the damage factor table from this page. | ||
damagesPerImpact <- opbase.data("Op_en5902.damagefactors") # Download the data from Opasnet Base. | |||
damagesPerImpact <- reshape( # Reshape it into the wide format. | |||
damagesPerImpact[ , colnames(damagesPerImpact) != "Obs"], | |||
times = "Result", | times = "Result", | ||
timevar = "Unique_categories", | timevar = "Unique_categories", | ||
Line 71: | Line 71: | ||
direction = "wide" | direction = "wide" | ||
) | ) | ||
colnames( | colnames(damagesPerImpact) <- gsub("Result.", "", colnames(damagesPerImpact)) # Remove extra "Result." from colnames. | ||
rownames( | rownames(damagesPerImpact) <- damagesPerImpact[[1]] # Make the first column the rownames. | ||
damagesPerImpact <- damagesPerImpact[ , 2:ncol(damagesPerImpact)] # Remove the first column. | |||
damagesPerImpact <- t(as.matrix(damagesPerImpact)) # Turn the data.frame into a matrix and transpose it. | |||
# Take the impact factor table from the database. Do the same procedures as with | # Take the impact factor table from the database. Do the same procedures as with damagesPerImpact. | ||
impactsPerDollar <- opbase.data("Op_en5902") | |||
impactsPerDollar <- reshape( | |||
impactsPerDollar, | |||
times = "Result", | times = "Result", | ||
timevar = "Unique_categories", | timevar = "Unique_categories", | ||
Line 86: | Line 86: | ||
direction = "wide" | direction = "wide" | ||
) | ) | ||
colnames( | colnames(impactsPerDollar) <- gsub("Result.", "", colnames(impactsPerDollar)) | ||
rownames( | rownames(impactsPerDollar) <- impactsPerDollar[[1]] | ||
impactsPerDollar <- impactsPerDollar[ , 2:ncol(impactsPerDollar)] | |||
impactsPerDollar <- as.matrix(impactsPerDollar) | |||
# Take the coffee cup | # Take the coffee cup direct requirements. | ||
coffee <- opbase.data("Op_en5902.coffeecupinputs") # Download the data from Opasnet Base. | coffee <- opbase.data("Op_en5902.coffeecupinputs") # Download the data from Opasnet Base. | ||
Line 100: | Line 100: | ||
print(xtable(coffee), type = 'html') | print(xtable(coffee), type = 'html') | ||
coffee <- merge(data.frame( | coffee <- merge(data.frame(DirectRequirements = rownames(impactsPerDollar)), coffee, all.x = TRUE) | ||
coffee$Result <- ifelse(is.na(coffee$Result), 0, coffee$Result) | coffee$Result <- ifelse(is.na(coffee$Result), 0, coffee$Result) | ||
normalisation <- EvalOutput(new("ovariable", | |||
name = "normalisation", | |||
data = tidy(opbase.data("Op_en5904"), objname="normalisation") | |||
)) | |||
out <- | normalisation@output | ||
impactsPerDollar <- impactsPerDollar * coffee$Result # Multiply data matrix with activities. | |||
out <- impactsPerDollar %*% damagesPerImpact | |||
# After matrix operations, turn the output into a data.frame for graphics. | # After matrix operations, turn the output into a data.frame for graphics. | ||
Line 111: | Line 118: | ||
out <- as.data.frame(out) | out <- as.data.frame(out) | ||
out$ | out$directRequirements <- rownames(out) | ||
out <- melt(out, idvars = " | out <- melt(out, idvars = "directRequirements", variable_name = "damages") | ||
out <- out[out$value >= sum(out$value) * limit , ] | out <- out[out$value >= sum(out$value) * limit , ] | ||
out <- dropall(out) | out <- dropall(out) | ||
# Rename the columns to reflect actual things. | |||
colnames(out)[colnames(out) == "value"] <- "Result" | |||
damages <- EvalOutput(new("ovariable", name = "Damage", data = out)) | |||
head(damages@output) | |||
damageFractions <- damages / normalisation * 365 | |||
head(damageFractions@output) | |||
cat("Effects smaller than", limit*100, "% of the total effect are not shown.\n") | cat("Effects smaller than", limit*100, "% of the total effect are not shown.\n") | ||
ggplot(out, aes(x = | ggplot(out, aes(x = Damage, weight = Result, fill = directRequirements)) + geom_bar() + | ||
theme_grey(base_size = 24) + | theme_grey(base_size = 24) + | ||
theme(axis.text.x = element_text(angle = 45)) + | theme(axis.text.x = element_text(angle = 45)) + |
Revision as of 10:05, 17 January 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 | Activity | 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>