Damage vector for life-cycle analysis: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(→‎Formula: code works and produces results)
Line 52: Line 52:
===Formula===
===Formula===


<rcode graphics="1">
<rcode graphics="1" variables="
name:limit|description:What is the smallest fraction of the total effect you want to see?|default:0.001
">


library(OpasnetUtils)
library(OpasnetUtils)
Line 93: Line 95:
coffee <- opbase.data("Op_en5902.coffeecupinputs") # Download the data from Opasnet Base.
coffee <- opbase.data("Op_en5902.coffeecupinputs") # Download the data from Opasnet Base.
coffee <- coffee[ , colnames(coffee) != "Obs"]
coffee <- coffee[ , colnames(coffee) != "Obs"]
head(coffee)
coffee <- merge(data.frame(Activity = rownames(data)), coffee, all.x = TRUE)
coffee <- merge(data.frame(Activity = rownames(data)), coffee, all.x = TRUE)
coffee$Result <- ifelse(is.na(coffee$Result), 0, coffee$Result)
coffee$Result <- ifelse(is.na(coffee$Result), 0, coffee$Result)
print(xtable(coffee), type = 'html')


data <- data * coffee$Result # Multiply data matrix with activities.
data <- data * coffee$Result # Multiply data matrix with activities.
head(data)


out <- data %*% damages
out <- data %*% damages
# After matrix operations, turn the output into a data.frame for graphics.


out <- as.data.frame(out)
out <- as.data.frame(out)
head(out)
 
out$idvars <- rownames(out)
out$idvars <- rownames(out)
out <- melt(out, idvars = "idvars")
out <- melt(out, idvars = "idvars")
head(out)
out <- out[out$value >= sum(out$value) * limit , ]
ggplot(out, aes(x = variable, weight = value)) + geom_bar()
out <- dropall(out)
ggplot(out, aes(x = variable, weight = value, fill = idvars)) + geom_bar()
 
cat("Effects smaller than", limit*100, "% of the total effect are not shown.\n")
 
ggplot(out, aes(x = variable, weight = value, fill = idvars)) + geom_bar() +
theme_grey(base_size = 24) +
opts(
axis.text.x = theme_text(angle = 45)
)


</rcode>
</rcode>

Revision as of 22:40, 16 January 2013



Question

What are the damages per unit purchased commodity using a life-cycle assessment?

Answer

Rationale

Dependencies

Data

damagefactors(-)
ObsUnique_categoriesHuman healthEcosystem qualityClimate changeResourcesWater consumption
1Carcinogens0.00000280000
2Non-carcinogens0.00000280000
3Respiratory inorganics0.00070000
4Ionizing radiation0.000000000210000
5Ozone layer depletion0.001050000
6Respiratory organics0.000002130000
7Aquatic ecotoxicity00.0000502000
8Terrestrial ecotoxicity00.00791000
9Terrestrial acidification/nutrification01.04000
10Land occupation01.09000
11Aquatic acidification00000
12Aquatic eutrophication00000
13Global warming00100
14Non-renewable energy00010
15Mineral extraction00010
16Water withdrawal00000
17Water consumption00001

Example of coffee cup

coffeecupinputs(Euro)
ObsActivityResult
131131A - Sugar cane mills and refining0.1
2112120 - Dairy cattle and milk production0.2
3311820 - Cookie, cracker, and pasta manufacturing0.5
4311920 - Coffee and tea manufacturing0.2
5221100 - Electric power generation, transmission, and distribution0.1
6322299 - All other converted paper product manufacturing0.04
7335210 - Small electrical appliance manufacturing0
8335221 - Household cooking appliance manufacturing0.01

Formula

What is the smallest fraction of the total effect you want to see?:

+ Show code

See also

Keywords

References


Related files

<mfanonymousfilelist></mfanonymousfilelist>