Difference between revisions of "OpasnetUtils/Drafts"

From Testiwiki
Jump to: navigation, search
(Answer: ana2ova added)
(Answer: unkeep removed because it is part of OpasnetUtils package now)
Line 15: Line 15:
 
  objects.latest("Op_en6007", code_name = "answer")
 
  objects.latest("Op_en6007", code_name = "answer")
  
<rcode name="answer" embed=0>
+
<rcode name="answer" embed=1>
  
 
library(OpasnetUtils)
 
library(OpasnetUtils)
Line 411: Line 411:
 
X@output <- out
 
X@output <- out
 
X@marginal <- colnames(X@output) %in% marginals
 
X@marginal <- colnames(X@output) %in% marginals
return(X)
 
}
 
 
unkeep <- function (X, cols = NA, sources = FALSE, prevresults = FALSE)
 
{
 
rescol <- paste(X@name, "Result", sep = "")
 
if (sources)
 
cols <- c(cols, colnames(X@output)[grepl("Source$", colnames(X@output))])
 
 
for(i in cols) { # Give warning about unkept indices with >1 locations.
 
if(
 
length(unique(X@output[[i]])) > 1 &
 
X@marginal[match(i, colnames(X@output))]
 
) {
 
warning(paste(
 
"There is >1 unique locations in column",
 
i, ":",
 
paste(as.character(unique(X@output[[i]])), collapse = ", ")
 
))
 
}
 
}
 
 
if (prevresults)
 
cols <- c(cols, colnames(X@output)[grepl("Result$", colnames(X@output)) &
 
colnames(X@output) != rescol])
 
 
marginals <- colnames(X@output)[X@marginal]
 
X@output <- X@output[!colnames(X@output) %in% cols]
 
X@marginal <- colnames(X@output) %in% marginals
 
 
 
return(X)
 
return(X)
 
}
 
}
Line 740: Line 710:
  
 
objects.store(ograph, collapsemarg, MyPointKML, ova2spat, MyRmap, MyPlotKML, truncateIndex, findrest,  
 
objects.store(ograph, collapsemarg, MyPointKML, ova2spat, MyRmap, MyPlotKML, truncateIndex, findrest,  
unkeep, timing, makeTimeline, timepoints, ana2ova)
+
timing, makeTimeline, timepoints, ana2ova)
  
 
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, unkeep, timing, makeTimeline, timepoints, ana2ova.\n"))
+
"truncateIndex, findrest, timing, makeTimeline, timepoints, ana2ova.\n"))
 
</rcode>
 
</rcode>
  

Revision as of 10:26, 18 September 2014



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>