Join operations supporting S4 class objects

left_join(x, y, by)

# S3 method for DataFrame
left_join(x, y, by)

Arguments

x, y

DataFrame. Data frames, or objects, to be coerced into a single object.

by

character. Column names to use for merge operation. Note that this is always required, unlike the dplyr tbl_df method, where this is optional.

See also

Examples

DataFrame <- S4Vectors::DataFrame ## DataFrame ==== df1 <- DataFrame( id = as.factor(seq(4L)), genotype = as.factor(rep(x = c("wt", "ko"), each = 2L)) ) print(df1)
#> DataFrame with 4 rows and 2 columns #> id genotype #> <factor> <factor> #> 1 1 wt #> 2 2 wt #> 3 3 ko #> 4 4 ko
df2 <- DataFrame( id = as.factor(seq(4L)), treatment = as.factor(rep(x = c("control", "expt"), times = 2L)) ) print(df2)
#> DataFrame with 4 rows and 2 columns #> id treatment #> <factor> <factor> #> 1 1 control #> 2 2 expt #> 3 3 control #> 4 4 expt
left_join(df1, df2, by = "id")
#> DataFrame with 4 rows and 3 columns #> id genotype treatment #> <factor> <factor> <factor> #> 1 1 wt control #> 2 2 wt expt #> 3 3 ko control #> 4 4 ko expt