Learn R Programming

poorman (version 0.2.1)

joins: Join two data.frames together

Description

Join two data.frames together

Usage

inner_join(x, y, by = NULL, suffix = c(".x", ".y"))

left_join(x, y, by = NULL, suffix = c(".x", ".y"))

right_join(x, y, by = NULL, suffix = c(".x", ".y"))

full_join(x, y, by = NULL, suffix = c(".x", ".y"))

Arguments

x, y

The data.frames to join.

by

A character vector of variables to join by. If NULL, the default, *_join() will do a natural join, using all variables with common names across the two tables. A message lists the variables so that you can check they're right (to suppress the message, simply explicitly list the variables that you want to join).

To join by different variables on x and y use a named vector. For example, by = c("a" = "b") will match x.a to y.b.

suffix

If there are non-joined duplicate variables in x and y, these suffixes will be added to the output to disambiguate them. Should be a character vector of length 2.