add_columns | R Documentation |
add_columns
inspired by MATCH FILES (Add
variables...) from SPSS Statistics. It works similar to SQL left join but
number of cases in the left part always remain the same. If there are
duplicated keys in the y
then error will be raised by default.
add_columns(x, y, by = NULL, ignore_duplicates = FALSE, ...)
x |
data.frame to be joined with |
y |
data.frame. |
by |
character vector or NULL(default) or 1. Names of common variables
in the |
ignore_duplicates |
logical Should we ignore duplicates in the |
... |
arguments for further methods |
data.frame
# example for 'add_columns' from base 'merge'
authors = data.frame(
surname = c("Tukey", "Venables", "Tierney", "Ripley", "McNeil"),
nationality = c("US", "Australia", "US", "UK", "Australia"),
deceased = c("yes", rep("no", 4))
)
books = data.frame(
surname = c("Tukey", "Venables", "Tierney",
"Ripley", "Ripley", "McNeil", "R Core"),
title = c("Exploratory Data Analysis",
"Modern Applied Statistics ...",
"LISP-STAT",
"Spatial Statistics", "Stochastic Simulation",
"Interactive Data Analysis",
"An Introduction to R")
)
add_columns(books, authors)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.