Description Usage Arguments Details Value Examples
merge method for Hashmap class
1 2 3 |
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
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | 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
)
|
Keys Values.x Values.y
1 D 4 4
2 E 5 5
Keys Values.x Values.y
1 D 4 4
2 E 5 5
Keys Values.x Values.y
1 A 1 NA
2 B 2 NA
3 C 3 NA
4 D 4 4
5 E 5 5
Keys Values.x Values.y
1 D 4 4
2 E 5 5
3 A 1 NA
4 B 2 NA
5 C 3 NA
Keys Values.x Values.y
1 G NA 7
2 H NA 8
3 D 4 4
4 E 5 5
5 F NA 6
Keys Values.x Values.y
1 D 4 4
2 E 5 5
3 G NA 7
4 H NA 8
5 F NA 6
Keys Values.x Values.y
1 A 1 NA
2 H NA 8
3 F NA 6
4 G NA 7
5 E 5 5
6 B 2 NA
7 C 3 NA
8 D 4 4
Keys Values.x Values.y
1 D 4 4
2 E 5 5
3 A 1 NA
4 B 2 NA
5 C 3 NA
6 G NA 7
7 H NA 8
8 F NA 6
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.