+ 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 benefic 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,
"}},
'''",
branchname,
"''' is a '''branch''' of Handprinter. This page is a test case how to manage branches.
== Question ==
How to estimate the life-cycle impacts of ",
branchname,
"?
== Answer ==
<rcode embed=1>
# This is code Op_en",
PAGEID,
"/ on page [[",
branchname,
"]]
library(OpasnetUtils)
objects.latest('Op_en",
PAGEID,
"', 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)'>
# This is code Op_en",
PAGEID,
"/",
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,
")
}
)
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_en",
PAGEID,
"/",
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.\n')",
"@/rcode>
",
intermediate.rationale,
"\n",
"== See also ==
* [[Handprinter]]
* [[Developing branches]]
",
"== Related files ==
",
sep = "")
#text2 <- substr("@", "<", text1) # NEEDED BUT DOES NOT WORK
text2 <- strsplit(text1, split = "\n")[[1]]
text2 <- data.frame(Pagetemplate = text2)
oprint(text2, include.rownames = FALSE)
| |