OpasnetUtils/Merge: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
mNo edit summary |
||
Line 12: | Line 12: | ||
label="Initiate functions" | label="Initiate functions" | ||
graphics="1" | graphics="1" | ||
showcode="1" | |||
> | > | ||
# SETMETHOD MERGE ########### merge of ovariables merges the 'output' slot by index columns except 'Unit'. | # SETMETHOD MERGE ########### merge of ovariables merges the 'output' slot by index columns except 'Unit'. |
Revision as of 10:51, 15 June 2012
Moderator:Nobody (see all) Click here to sign up. |
This page is a stub. You may improve it into a full page. |
Upload data
|
Description
Merge of ovariables merges the 'output' slot by index columns except 'Unit'.
Code
# 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", 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)) } ) |