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.
Usage
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,
...
)Arguments
- x, y
Matrixor matrix-like object- by.x
vector indicating the names to match from
Matrixx- by.y
vector indicating the names to match from
Matrixy- all.x
logical; if
TRUE, then each value inxwill be included even if it has no matching values iny- all.y
logical; if
TRUE, then each value inywill be included even if it has no matching values inx- 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