Damage vector for life-cycle analysis: Difference between revisions

From Opasnet
Jump to navigation Jump to search
(→‎Formula: reshape corrected, now it works)
(→‎Formula: coffee cup activities added)
Line 35: Line 35:
Water withdrawal|0|0|0|0|0
Water withdrawal|0|0|0|0|0
Water consumption|0|0|0|0|1
Water consumption|0|0|0|0|1
</t2b>
===Example of coffee cup===
<t2b name="coffeecupinputs" index="Activity" obs="Result" unit="Euro">
31131A  Sugar cane mills and refining|0.1
112120  Dairy cattle and milk production|0.2
311820  Cookie cracker and pasta manufacturing|0.5
311920  Coffee and tea manufacturing|0.2
221100  Electric power generation transmission and distribution|0.1
322299  All other converted paper product manufacturing|0.04
335210  Small electrical appliance manufacturing|0
335221  Household cooking appliance manufacturing|0.01
</t2b>
</t2b>


===Formula===
===Formula===


<rcode>
<rcode graphics="1">
 
library(OpasnetUtils)
library(OpasnetUtils)
library(xtable)
library(xtable)
library(ggplot2)
library(reshape)


data <- opbase.data("Op_en5902") #  
# Take the damage factor table from this page.
damages <- opbase.data("Op_en5902.damagefactors")
head(damages)


data <- reshape(data, times = "Result", timevar = "Unique_categories", idvar = "Purchasing_sector", direction = "wide")
damages <- opbase.data("Op_en5902.damagefactors") # Download the data from Opasnet Base.
damages <- reshape( # Reshape it into the wide format.
damages[ , colnames(damages) != "Obs"],  
times = "Result",  
timevar = "Unique_categories",  
idvar = "Damage_categories",  
direction = "wide"
)
colnames(damages) <- gsub("Result.", "", colnames(damages)) # Remove extra "Result." from colnames.
rownames(damages) <- damages[[1]] # Make the first column the rownames.
damages <- damages[ , 2:ncol(damages)] # Remove the first column.
damages <- t(as.matrix(damages)) # Turn the data.frame into a matrix and transpose it.


# Take the impact factor table from the database. Do the same procedures as with damages.
data <- opbase.data("Op_en5902")
data <- reshape(
data,
times = "Result",
timevar = "Unique_categories",
idvar = "Purchasing_sector",
direction = "wide"
)
colnames(data) <- gsub("Result.", "", colnames(data))
colnames(data) <- gsub("Result.", "", colnames(data))
rownames(data) <- data[[1]]
data <- data[ , 2:ncol(data)]
data <- as.matrix(data)
data <- as.matrix(data)


# Take the coffee cup activities.
coffee <- opbase.data("Op_en5902.coffeecupinputs") # Download the data from Opasnet Base.
head(coffee)
coffee <- merge(data.frame(Activity = rownames(data)), coffee, all.x = TRUE)
coffee$Result <- ifelse(is.na(coffee$Result), 0, coffee$Result)
head(coffee)
data <- data * coffee$Result # Multiply data matrix with activities.
head(data)
head(data)


out <- data %*% damages
out <- as.data.frame(out)
head(out)
out$idvars <- rownames(out)
out <- melt(out, idvars = "idvars")
head(out)
ggplot(out, aes(x = variable, weight = value)) + geom_bar()
ggplot(out, aes(x = variable, weight = value, fill = idvars)) + geom_bar()


</rcode>
</rcode>

Revision as of 22:15, 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

+ Show code

See also

Keywords

References


Related files

<mfanonymousfilelist></mfanonymousfilelist>