rbind_common: Combine data.frames by row, using only common columns.

View source: R/rbind_common.r

rbind_commonR Documentation

Combine data.frames by row, using only common columns.

Description

rbinds a list of data.frames, using only these columns which occur in each of the single data.frames.

Usage

rbind_common(...)

Arguments

...

input data frames to row bind together. The first argument can be a list of data frames, in which case all other arguments are ignored. Any NULL inputs are silently dropped. If all inputs are NULL, the output is NULL. If the data.frames have no common columns, the output is NULL and a warning is given.

Value

a single data frame

Examples

### data frame 1
df1 <- data.frame ( a = 1:3, b = TRUE)

### data frame 2
df2 <- data.frame ( d = 100, a = 11:13)

### data frame 3
df3 <- data.frame ( d = 1000, x = 101:103)

### one common col
rbind_common(df1, df2)

### no common cols
rbind_common(df1, df2, df3)

eatTools documentation built on May 29, 2024, 6:03 a.m.