mergeDataFrames: Merge a list of data.frames

Description Usage Arguments Examples

View source: R/dataManipulations.R

Description

This function takes in a list of data sets and merges them all together as a series of left joins. There are some mandatory merge fields and some optional fields that we will try to merge on if they exist. We assume that the first element in the list is complete and has both the optional and the mandatory columns.

Usage

1
mergeDataFrames(datasets, mandatoryMergeFields, optionalMergeFields = NULL)

Arguments

datasets

a list of data.frames with column names

mandatoryMergeFields

The fields that will be used in the join

optionalMergeFields

The fields that will be used in the join if they exist

Examples

1
2
3
4
d1 = mtcars
d2 = mtcars
colnames(d2)[!colnames(d2)%in%c("gear","carb")] = LETTERS[1:(ncol(d2)-2)]
View(mergeDataFrames(list(d1, d2), c("gear", "carb")))

ivanliu1989/RQuant documentation built on Sept. 13, 2019, 11:53 a.m.