Learn R Programming

crunch (version 1.12.2)

extendDataset: Add columns from one dataset to another, joining on a key

Description

As merge does for data.frames, this function takes two datasets, matches rows based on a specified key variable, and adds columns from one to the other.

Usage

extendDataset(x, y, by.x, by.y, all = FALSE, all.x = TRUE, all.y = FALSE, ...)
"merge"(x, y, by.x, by.y, all = FALSE, all.x = TRUE, all.y = FALSE, ...)

Arguments

x
CrunchDataset to add data to
y
CrunchDataset to copy data from. May be filtered by rows and/or columns.
by.x
CrunchVariable in x on which to join. Must have all unique, non-missing values.
by.y
CrunchVariable in y on which to join. Must have all unique, non-missing values.
all
logical: should all rows in x and y be kept, i.e. a "full outer" join? Only FALSE is currently supported.
all.x
logical: should all rows in x be kept, i.e. a "left outer" join? Only TRUE is currently supported.
all.y
logical: should all rows in y be kept, i.e. a "right outer" join? Only FALSE is currently supported.
...
additional arguments, ignored

Value

x extended by the columns of y, matched on the "by" variables.