+ Show code- Hide code
library(OpasnetUtils)
t2bdata <- ""
#wiki_username <- "Jouni"
#branchname <- "Garden tower branch"
#PAGEID <- "1234"
#output.ovariable <- "gardentower"
#intermediate.ovariable <- "vegeproduction"
#t2bdata <- "tobefilled"
#dependencies <- c("vegeproduction", "wasteproduction", "waterconsumption")
#output.rationale <- "Garden tower composts kitchen waste and turns it into soil."
#intermediate.rationale <- "vegeproduction is the amount of vegetables produced in the garden tower. It is a critical benefit that reduces consumption of other products and thus footprint."
#<t2b name='Tire inflation parameters' index='Parameter,Unit' obs='Result' unit='-'>
#Pressure drop per temperature drop|PSI /10°F|0.5:1:2
#Fuel economy sensitivity|% /PSI|0.4
#Miles driven per year|mi /a|10000
#Fuel consumption|gl /mi|0.04
#Pressure deficit|PSI|2
#</t2b>
text1 <- paste("[[Category:Life cycle assessment]]
[[Category:Handprinter]]
{{method|moderator=",
wiki_username,
"}}
",
"'''{{PAGENAME}}''' is a '''branch''' of Handprinter. This page is a test case how to manage branches.
== Question ==
How to estimate the life-cycle impacts of '''{{PAGENAME}}'''?
== Answer ==
@rcode embed=1 variables='
name:PAGEID|type:hidden|default:`{{PAGEID}}`
'>
# This is code Op_enXXXX/ on page [[",
branchname,
"]]
library(OpasnetUtils)
objects.latest(paste('Op_en', PAGEID, sep = ''), code_name = '",
output.ovariable,
"')
",
output.ovariable,
" <- EvalOutput(",
output.ovariable,
")
oprint(summary(",
output.ovariable,
"))
@/rcode>
== Rationale ==
=== ",
output.ovariable,
" ===
@rcode name='",
output.ovariable,
"' embed=1 label='Initiate ",
output.ovariable,
" (for developers only)' variables='
name:PAGEID|type:hidden|default:`{{PAGEID}}`
'>
# This is code Op_enXXXX/",
output.ovariable,
" on page [[",
branchname,
"]]
library(OpasnetUtils)
",
output.ovariable,
" <- Ovariable('",
output.ovariable,
"',
dependencies = data.frame(
Name = c('",
paste(dependencies, collapse = "', '"),
")
),
formula = function(...) {
",
output.ovariable,
" <- ",
intermediate.ovariable,
"
return(",
output.ovariable,
")
}
)
rm(wiki_username)
objects.store(list=ls())
cat('Objects', ls(), 'stored.\n')
@/rcode>
",
output.rationale,
"
",
"=== ",
intermediate.ovariable,
" ===
",
t2bdata,
"@rcode name='",
intermediate.ovariable,
"' embed=1 label='Initiate ",
intermediate.ovariable,
" (for developers only)'>
# This is code Op_enXXXX/",
intermediate.ovariable,
" on page [[",
branchname,
"]]
library(OpasnetUtils)
",
intermediate.ovariable,
" <- Ovariable('",
intermediate.ovariable,
"',
ddata = 'Op_en{{PAGEID}}',
subset = ",
intermediate.ovariable,
")
objects.store(",
intermediate.ovariable,
")
cat('",
intermediate.ovariable,
"stored.@@')
",
"@/rcode>
",
intermediate.rationale,
"
",
"== See also ==
* [[Handprinter]]
* [[Developing branches]]
",
"== Related files ==
",
sep = "")
text2 <- strsplit(text1, split = "\n")[[1]]
text2 <- gsub("@@", "\n", text2)
text2 <- gsub("@", "<", text2)
text2 <- data.frame(Pagetemplate = text2)
oprint(text2, include.rownames = FALSE)
| |