Difference between revisions of "OpasnetUtils/Drafts"

From Testiwiki
Jump to: navigation, search
(Answer)
(Answer)
Line 723: Line 723:
 
orbind2 <- function( # Like orbind but the value is an ovariable.
 
orbind2 <- function( # Like orbind but the value is an ovariable.
 
o1, # ovariable whose slots are used in the value.
 
o1, # ovariable whose slots are used in the value.
o2 # ovariable
+
o2, # ovariable
 +
use_fillna = FALSE # Do we use fillna to fill in the NA values in indices?
 
) {
 
) {
 
x <- unkeep(o1 * 1, prevresults = TRUE, sources = TRUE)
 
x <- unkeep(o1 * 1, prevresults = TRUE, sources = TRUE)
Line 733: Line 734:
 
out <- o1
 
out <- o1
 
out@output <- orbind(x, y)
 
out@output <- orbind(x, y)
 +
 +
if(use_fillna) {
 +
b <- character()
 +
for(i in colnames(out@output)[out@marginal]) {if(any(is.na(out@output[[i]]))) b <- c(b, i)}
 +
if(length(b) > 0) {
 +
out@output <- fillna(out@output, b)
 +
warning("Missing values had to be filled by function fillna in indices: ", b, "\n")
 +
}
 +
}
 +
 
colnames(out@output)[colnames(out@output) == "Result"] <- paste(o1@name, "Result", sep = "")
 
colnames(out@output)[colnames(out@output) == "Result"] <- paste(o1@name, "Result", sep = "")
 
out@marginal <- colnames(out@output) %in% c(xmarg, ymarg)
 
out@marginal <- colnames(out@output) %in% c(xmarg, ymarg)

Revision as of 11:00, 18 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>