This function is used by the Merge Two Data Frames dialog.
USAGE:
menuMergeDataFrame(x, y, method = "All Common Cols", by.x, by.y,
all.x = all, all.y = all, suffixes.x = "",
suffixes.y = "", save.name = NULL,
show.p = .Options$show.data.in.view)
REQUIRED ARGUMENTS:
x
a data frame, or something to be converted into a data frame.
y
a data frame, or something to be converted into a data frame.
method
a character string indicating the method for matching rows which may be
"All Common Cols", "Row Names", or "Specified Cols". If "All Common Cols",
rows with identical values on the common columns in the two data frames will
be merged. If "Row Names", rows with the same row names in the two data frames
will be merged. If "Specified Cols", the columns for matching may be specified
in
by.x and
by.y.
OPTIONAL ARGUMENTS:
by.x
a vector of columns of
x to match by.
This can be a vector of column names,
column numbers, or a logical vector with
TRUE or
FALSE for each column,
telling which columns to match by.
by.y
a vector of columns of
y to match by.
This can be a vector of column names,
column numbers, or a logical vector with
TRUE or
FALSE for each column,
telling which columns to match by.
all.x
if
TRUE, then extra rows will be added to the output,
one for each row in
x that has no matching row in
y.
These rows will have
NAs in the columns that are usually filled
with values from
y.
The default is
FALSE, so that only rows with data from both
x and
y are
included in the output.
all.y
a logical value. This is analogous to
all.x,
controlling when the output contains rows for
y rows
with no matching
x row.
suffixes.x
a character string.
If
x and
y have some column names in common and those
columns are not used for matching,
then the output would have two columns with the same name,
which is not allowed for data frames.
Merge will paste suffixes onto these repeated column names
to make them unique.
If
suffixes.x and
suffixes.y are identical then
.1
and
.2 will be appended to the suffixes to make them unique.
suffixes.y
see
suffixes.x
save.name
character string giving name under which to save result. If this is
specified the result will be assigned to the working database under the
given name, and will also be returned invisibly.
show.p
logical flag: if TRUE,
save.name is specified, and the Windows S-PLUS GUI
is active, the result will be displayed in a Data Window.
VALUE:
invisibly returns a data frame containing the merging of
x and
y.