mergeDF {ThomasJeffersonUniv} | R Documentation |
An Alternative Merge Operation
Description
..
Usage
mergeDF(
x,
table,
by = character(),
by.x = character(),
by.table = character(),
...
)
Arguments
x |
data.frame, on which new columns will be added.
All rows of |
table |
data.frame, columns of which will be added to |
by |
|
by.x , by.table |
|
... |
additional parameters of matchDF |
Value
Function mergeDF returns a data.frame.
Note
We avoid merge.data.frame as much as possible,
because it's slow and
even sort = FALSE
may not completely retain the original order of input x
.
Examples
# examples inspired by ?merge.data.frame
(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(
name = c('Tukey', 'Venables', 'Tierney', 'Ripley',
'Ripley', 'McNeil', 'R Core', 'Diggle'),
title = c(
'Exploratory Data Analysis',
'Modern Applied Statistics',
'LISP-STAT', 'Spatial Statistics', 'Stochastic Simulation',
'Interactive Data Analysis', 'An Introduction to R',
'Analysis of Longitudinal Data'),
other.author = c(
NA, 'Ripley', NA, NA, NA, NA, 'Venables & Smith',
'Heagerty & Liang & Scott Zeger')))
(m = mergeDF(books, authors, by.x = 'name', by.table = 'surname'))
attr(m, 'nomatch')
[Package ThomasJeffersonUniv version 0.1.3 Index]