idaMerge {ibmdbR} | R Documentation |
Merge IDA data frames
Description
This function merges two IDA data frames(that is, two objects of the class ida.data.frame
).
Usage
idaMerge(x, y, by=intersect(x@cols, y@cols), by.x=by, by.y=by,
all=FALSE, all.x=all, all.y=all, sort=TRUE,
suffixes=c("_x", "_y"), table=NULL)
Arguments
x |
The first |
y |
The second |
by |
Specification of the common columns; see the Details section. |
by.x |
Specification of the common columns; see the Details section. |
by.y |
Specification of the common columns; see the Details section. |
all |
Whether non-matching columns of |
all.x |
If columns from only one of the IDA data frames being merged are to be included in the output,
set its corresponding parameter to TRUE and the other parameter to FALSE.
In SQL database terminology, specifying If If |
all.y |
Analogous to |
sort |
This parameter is ignored. The output is never sorted regardless of the setting of this parameter. |
suffixes |
Two 2-character strings, each of which specifies a suffix that is
used when generating column names.
By specifying different suffixes, you can ensure that each column
can be uniquely attributed to either |
table |
Name of the output IDA data frame. |
Details
This function merges two IDA data frames on the columns that they have in common. The rows in the two data frames that match on the specified columns are extracted, and joined together. If there is more than one match, all possible matches contribute one row each. For the precise meaning of ‘match’.
If by
or both by.x
and by.y
are of length 0 (a
length zero vector or NULL
), the result, r
, is the
Cartesian product of x
and y
, that is, a cross join.
If non-merged columns of the data frames have identical names and are to be included in the output, suffixes are appended to the names of the corresponding columns in the output to make their names unique.
Note that this function creates, in the current database, a view that corresponds to the output object. Within the current session, this view can be accessed using the same IDA data frame object. However, it is persistent and, after it is no longer needed, it must be dropped manually.
Value
A ida.data.frame
object.
See Also
Examples
## Not run:
idf <- ida.data.frame('IRIS')
#Perform a self-join
idf2 <- idaMerge(idf,idf,by="ID")
## End(Not run)