join: Join two dataframes together

Description Usage Arguments Details Value Examples

Description

Join two dataframes by the same id column.

Usage

1
2
3
4
5
6
7
8
9
join_inner(x, y, by = NULL)

join_full(x, y, by = NULL)

join_left(x, y, by = NULL)

join_right(x, y, by = NULL)

join_out(x, y, by = NULL)

Arguments

x

one dataframe

y

the other dataframe

by

the id name in x and y dataframe

Details

join_inner(), join_full(), join_left(), join_right() and join_out() are five functons to joint two dataframes together. They are based on package 'data.table', so they are more efficient and fast.

Value

one joined dataframe.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
df1=data.frame(x=rep(c('b','a','c'),each=3),
              y=c(1,3,6),
              v=1:9)

df2=data.frame(x=c('c','b','e'),
               v=8:6,
               foo=c(4,2,1))
join_inner(df1,df2,'x')
join_full(df1,df2,'x')
join_left(df1,df2,'x')
join_right(df1,df2,'x')
join_out(df1,df2,'x')

do documentation built on Aug. 3, 2021, 5:06 p.m.