左连接实际上将你的“x”tibble与“y”tibble合并,保留x的所有条目,但只连接y(通过特定变量)与x中匹配的条目。
,你可以在这里看到下面
dataframe "x"
rank title
<chr> <chr>
1 2,801. Lines
2 2,802. Nocno zivljenje
3 2,803. Saber Google
4 2,804. Sacred Vow
5 2,805. Was hat uns bloß so ruiniert
6 2,806. Our Time
7 2,807. Orecchie
8 2,808. Marshrut postroen
9 2,809. Shor Se Shuruaat
10 2,810. Oru Murai Vanthu Paarthaya
dataframe "y"
rank genre
1 2,801. Drama
2 2,802. Crime, Drama, Mystery
3 2,803. Comedy
4 2,804. Drama
5 2,805. Comedy
6 2,806. Drama
应用left_join
left_join(x,y, by ="rank")
" rank title genre
<chr> <chr> <chr>
1 2,801. Lines Drama
2 2,802. Nocno zivljenje Crime, Drama, Mystery
3 2,803. Saber Google Comedy
4 2,804. Sacred Vow <NA>
5 2,805. Was hat uns bloß so ruiniert <NA>
6 2,806. Our Time <NA>
7 2,807. Orecchie <NA>
8 2,808. Marshrut postroen <NA>
9 2,809. Shor Se Shuruaat <NA>
10 2,810. Oru Murai Vanthu Paarthaya <NA>"
参见[这](https://stackoverflow.com/questions/38549/what-is-后内部连接和外部连接之间的差异)和[this](http://stat545.com/bit001_dplyr-cheatsheet.html#left_joinsuperheroes-publishers)。 dplyr基本上做了一个左外连接。另请参阅[this](https://stackoverflow.com/questions/1299871/how-to-join-merge-data-frames-inner-outer-leftright)所有不同的软件包和基础R连接 –