join: Join operations

Description Usage Arguments Value Ordering Row names Note See Also Examples

Description

Join operations

Usage

 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
innerJoin(x, y, by, ...)

leftJoin(x, y, by, ...)

rightJoin(x, y, by, ...)

fullJoin(x, y, by, ...)

semiJoin(x, y, by, ...)

antiJoin(x, y, by, ...)

## S4 method for signature 'DataFrame,DataFrame,character'
innerJoin(x, y, by)

## S4 method for signature 'DataFrame,DataFrame,character'
leftJoin(x, y, by)

## S4 method for signature 'DataFrame,DataFrame,character'
rightJoin(x, y, by)

## S4 method for signature 'DataFrame,DataFrame,character'
fullJoin(x, y, by)

## S4 method for signature 'DataFrame,DataFrame,character'
semiJoin(x, y, by)

## S4 method for signature 'DataFrame,DataFrame,character'
antiJoin(x, y, by)

Arguments

x

Object.

y

Object.

by

character. Column names to use for join operation.

...

Additional arguments.

Value

New object containing a merge of x and y objects.

Ordering

The join functions never rearrange rows. To accomplish this, we're currently setting an internal .idx column that we can use to reorder the rows after merge() operation.

Row names

Unlike the S3 methods defined in dplyr, the join methods defined here for DataFrame always preserve row names.

Note

Updated 2019-09-03.

See Also

These functions are inspired by dplyr. However, they are designed to only work on Bioconductor S4 class objects, and use base R code internally.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
data(band_members, band_instruments)

## DataFrame ====
x <- band_members
print(x)
y <- band_instruments
print(y)
by <- "name"
innerJoin(x = x, y = y, by = by)
leftJoin(x = x, y = y, by = by)
rightJoin(x = x, y = y, by = by)
fullJoin(x = x, y = y, by = by)
semiJoin(x = x, y = y, by = by)
antiJoin(x = x, y = y, by = by)

steinbaugh/S4Transformer documentation built on Jan. 9, 2020, 7:30 p.m.