merge.Matrix | R Documentation |
Implementation of merge
for Matrix
. By explicitly
calling merge.Matrix
it will also work for matrix
, for
data.frame
, and vector
objects as a much faster alternative to
the built-in merge
.
merge.Matrix(
x,
y,
by.x,
by.y,
all.x = TRUE,
all.y = TRUE,
out.class = class(x)[1],
fill.x = ifelse(is(x, "sparseMatrix"), FALSE, NA),
fill.y = fill.x,
...
)
join.Matrix(
x,
y,
by.x,
by.y,
all.x = TRUE,
all.y = TRUE,
out.class = class(x)[1],
fill.x = ifelse(is(x, "sparseMatrix"), FALSE, NA),
fill.y = fill.x,
...
)
x , y |
|
by.x |
vector indicating the names to match from |
by.y |
vector indicating the names to match from |
all.x |
logical; if |
all.y |
logical; if |
out.class |
the class of the output object. Defaults to the class of x. Note that some output classes are not possible due to R coercion capabilities, such as converting a character matrix to a Matrix. |
fill.x , fill.y |
the value to put in merged columns where there is no match. Defaults to 0/FALSE for sparse matrices in order to preserve sparsity, NA for all other classes |
... |
arguments to be passed to or from methods. Currently ignored |
#' all.x/all.y
correspond to the four types of database joins in the
following way:
all.x=TRUE
, all.y=FALSE
all.x=FALSE
, all.y=TRUE
all.x=FALSE
, all.y=FALSE
all.x=TRUE
, all.y=TRUE
Note that NA
values will match other NA
values.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.