Difference between revisions of "Cradle through consumer BEA"

From Testiwiki
Jump to: navigation, search
(Dependencies)
(code updated, now works. Documentation improved)
Line 8: Line 8:
 
== Answer ==
 
== Answer ==
  
 +
<rcode name="answer" embed=1>
 +
library(OpasnetUtils)
 +
 +
objects.latest("Op_en6286", code_name = "initiate") # [[Cradle through consumer BEA]]
 +
 +
oprint(head(EvalOutput(BEA)@output))
 +
 +
</rcode>
  
 
== Rationale ==
 
== Rationale ==
  
<ref>Greg Norris: Personal communication 31 Jan 2014.</ref>
+
<ref>Greg Norris: Personal communication 31 Jan 2014. File name: \\cesium\jtue$\_Documents\Handprinter\CradleThroughConsumerBEA.xls </ref>
  
 
=== Dependencies ===
 
=== Dependencies ===
  
[http://en.opasnet.org/en-opwiki/index.php?title=Cradle_through_consumer_BEA&oldid=31473 Code that was used to upload the data] on 5 Feb 2014.
+
[http://en.opasnet.org/en-opwiki/index.php?title=Cradle_through_consumer_BEA&oldid=31473 Code that was used to upload the data] on 5 Feb 2014. [http://en.opasnet.org/en-opwiki/index.php?title=Cradle_through_consumer_BEA&oldid=31477 Upload history]
 
 
The actual successful runs:
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=YXnuqeZT8o5LcDPW]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=Becopgjetmq8eBI0]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=KDgoitDUzk6nuA9H]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=VndxWbObV6I35V6F]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=GrNTLplN3Kj2kNef]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=lBM5j4tIPrVmJEgL]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=I9Km9dfPUuXtY7k4]
 
 
 
The failed runs:
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=cREEbk6w6SWRMewZ]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=ZEj1ZuNwDqMyTQ9g]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=D2gPElA70AiNPHMR]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=nQMv5OOwFTUMsUTw]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=dry58tgn8BN5lA24]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=1TQ5Zg5WozZtIx9z]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=a3gAipLU5eRj0jhN]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=geQ9pMdY59Zg9if1]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=i8QcAEo3eyGaQgj9]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=aDTeW9kByI1j1gGI]
 
[http://en.opasnet.org/en-opwiki/index.php?title=Special:RTools&id=lBM5j4tIPrVmJEgL]
 
  
 
=== Calculations ===
 
=== Calculations ===
Line 44: Line 30:
 
library(OpasnetUtils)
 
library(OpasnetUtils)
  
 +
categories <- opbase.data("Op_en6286", subset = "Categories")
 
climate <- opbase.data("Op_en6286", subset = "Climate change")
 
climate <- opbase.data("Op_en6286", subset = "Climate change")
 
ecosystem <- opbase.data("Op_en6286", subset = "Ecosystem quality")
 
ecosystem <- opbase.data("Op_en6286", subset = "Ecosystem quality")
Line 52: Line 39:
 
water$Result <- water$Result * 3.785411784 # From gallons to litres
 
water$Result <- water$Result * 3.785411784 # From gallons to litres
  
categories <- data.frame(climate[1:3]
+
levels(categories[["Category"]]) <- gsub("  ", "", levels(categories[["Category"]]))
levels(categories[["Category"]]) <- gsub("  ", "", levels(categories[["Category"]]))  
+
# One trailing space may stay but $ does not work in regular expression. Why?
# One training space may stay but $ does not work in regular expression. Why?
 
  
categories <- Ovariable("categories", data = categories, Result = 1))
+
categories <- Ovariable("categories", data = categories, Result = 1)
  
 
BEA <- rbind(
 
BEA <- rbind(
data.frame(Impact = "Climate change", Unit = "CO2eq /USD", climate[3:ncol(climate)]),
+
data.frame(Impact = "Climate change", Unit = "CO2eq /USD", climate),
 
data.frame(Impact = "Ecosystem quality", Unit = "PDF m2 /a /USD", ecosystem),
 
data.frame(Impact = "Ecosystem quality", Unit = "PDF m2 /a /USD", ecosystem),
 
data.frame(Impact = "Human health", Unit = "DALY /USD", health),
 
data.frame(Impact = "Human health", Unit = "DALY /USD", health),
Line 81: Line 67:
 
<references/>
 
<references/>
  
==Related files==<!-- __OBI_TS:1391436420 -->
+
==Related files==

Revision as of 11:50, 13 March 2014



Question

What are the life-cycle impacts of products from cradle to consumer?

Answer

+ Show code

Rationale

[1]

Dependencies

Code that was used to upload the data on 5 Feb 2014. Upload history

Calculations

+ Show code

See also

Keywords

References

  1. Greg Norris: Personal communication 31 Jan 2014. File name: \\cesium\jtue$\_Documents\Handprinter\CradleThroughConsumerBEA.xls

Related files