| merge {hashmap} | R Documentation |
merge method for Hashmap class
## S3 method for class 'Rcpp_Hashmap'
merge(x, y, type = c("inner", "left", "right", "full"),
...)
x |
an object created by a call to |
y |
an object created by a call to |
type |
a character string specifying the type of join, with partial argument matching (abbreviation) supported. |
... |
not used. |
Valid arguments for type are:
"inner": similar to all = FALSE in base::merge
"left": similar to all.x = TRUE in base::merge
"right": similar to all.y = TRUE in base::merge
"full": similar to all = TRUE in base::merge
The default value for type is "inner".
a data.frame.
hx <- hashmap(LETTERS[1:5], 1:5)
hy <- hashmap(LETTERS[4:8], 4:8)
## inner join
merge(hx, hy)
merge(
hx$data.frame(),
hy$data.frame(),
by = "Keys",
sort = FALSE
)
## left join
merge(hx, hy, "left")
merge(
hx$data.frame(),
hy$data.frame(),
by = "Keys",
all.x = TRUE,
sort = FALSE
)
## right join
merge(hx, hy, "right")
merge(
hx$data.frame(),
hy$data.frame(),
by = "Keys",
all.y = TRUE,
sort = FALSE
)
## full outer join
merge(hx, hy, "full")
merge(
hx$data.frame(),
hy$data.frame(),
by = "Keys",
all = TRUE,
sort = FALSE
)