Difference between revisions of "OpasnetUtils/Merge"

From Testiwiki
Jump to: navigation, search
m
m
Line 8: Line 8:
  
 
==Code==
 
==Code==
<rcode
 
name="Merge"
 
label="Initiate functions"
 
graphics="1"
 
showcode="1"
 
>
 
# SETMETHOD MERGE ########### merge of ovariables merges the 'output' slot by index columns except 'Unit'.
 
temp <- setMethod(f = "merge",
 
signature = signature(x = "ovariable", y = "ovariable"),
 
definition = function(x, y) {
 
test <- intersect(colnames(x@output[x@marginal]), colnames(y@output[y@marginal]))
 
x@output <- merge(x@output, y@output, by = test, all = TRUE)
 
return(x)
 
}
 
)
 
  
temp <- setMethod(f = "merge",
+
https://www.opasnet.org/svn/opasnet_utils/trunk/R/Merge.r
signature = signature(x = "ovariable", y = "numeric"),
 
definition = function(x, y) {
 
y <- make.ovariable(y)
 
return(merge(x, y))
 
}
 
)
 
 
 
temp <- setMethod(f = "merge",
 
signature = signature(x = "numeric", y = "ovariable"),
 
definition = function(x, y) {
 
x <- make.ovariable(x)
 
return(merge(y, x))
 
}
 
)
 
</rcode>
 
  
 
==See also==
 
==See also==

Revision as of 13:38, 16 August 2012



Description

Merge of ovariables merges the 'output' slot by index columns except 'Unit'.

Code

https://www.opasnet.org/svn/opasnet_utils/trunk/R/Merge.r

See also