Difference between revisions of "OpasnetUtils/Drafts"

From Testiwiki
Jump to: navigation, search
(Answer)
(Answer)
Line 720: Line 720:
 
return(out)
 
return(out)
 
}
 
}
 +
 +
orbind2 <- function( # Like orbind but the value is an ovariable.
 +
o1, # ovariable whose slots are used in the value.
 +
o2 # ovariable
 +
) {
 +
x <- unkeep(o1 * 1, prevresults = TRUE, sources = TRUE)
 +
y <- unkeep(o2 * 1, prevresults = TRUE, sources = TRUE)
 +
xmarg <- colnames(x@output)[x@marginal]
 +
ymarg <- colnames(y@output)[y@marginal]
 +
for(i in xmarg) x@output[[i]] <- as.factor(x@output[[i]])
 +
for(i in ymarg) y@output[[i]] <- as.factor(y@output[[i]])
 +
out <- o1
 +
out@output <- orbind(x, y)
 +
colnames(out@output)[colnames(out@output) == "Result"] <- paste(o1@name, "Result", sep = "")
 +
out@marginal <- colnames(out@output) %in% c(xmarg, ymarg)
 +
 +
return(out)
 +
}
 +
  
 
objects.store(ograph, collapsemarg, MyPointKML, ova2spat, MyRmap, MyPlotKML, truncateIndex, findrest,  
 
objects.store(ograph, collapsemarg, MyPointKML, ova2spat, MyRmap, MyPlotKML, truncateIndex, findrest,  
timing, makeTimeline, timepoints, ana2ova)
+
timing, makeTimeline, timepoints, ana2ova, orbind2)
  
 
cat(paste("The following objects are stored: ograph, collapsemarg, MyPointKML, ova2spat, MyRmap, MyPlotKML,",
 
cat(paste("The following objects are stored: ograph, collapsemarg, MyPointKML, ova2spat, MyRmap, MyPlotKML,",
"truncateIndex, findrest, timing, makeTimeline, timepoints, ana2ova.\n"))
+
"truncateIndex, findrest, timing, makeTimeline, timepoints, ana2ova, orbind2.\n"))
 
</rcode>
 
</rcode>
  

Revision as of 15:24, 17 February 2015



Question

Which functions are so useful that they should be taken into OpasnetUtils package? This page contains draft function which will be included when they are good enough and found important.

Answer

Call the objects stored by this code from another rode with this command:

objects.latest("Op_en6007", code_name = "answer")

+ Show code

See also

References


Related files

<mfanonymousfilelist></mfanonymousfilelist>