CBIND: cbind 'data.frames' with different number of rows

Description Usage Arguments Details Author(s) See Also Examples

Description

cbind does not work when trying to combine data.frames with differing numbers of rows. This function takes a list of data.frames, identifies how many extra rows are required to make cbind work correctly, and does the combining for you.

Usage

1
  CBIND(datalist)

Arguments

datalist

A list of data.frames that you want to combine by columns.

Details

The CBIND function also works with nested lists by first "flattening" them using the LinearizeNestedList function by Akhil S Bhel.

Author(s)

Ananda Mahto

See Also

cbind, cbindX, LinearizeNestedList

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
# Example data
df1 <- data.frame(A = 1:5, B = letters[1:5])
df2 <- data.frame(C = 1:3, D = letters[1:3])
df3 <- data.frame(E = 1:8, F = letters[1:8], G = LETTERS[1:8])

CBIND(list(df1, df2, df3))

# Nested lists:
test1 <- list(list(df1, df2, df3), df1)
str(test1)

CBIND(test1)

mrdwab/AMsnippets documentation built on May 23, 2019, 7:15 a.m.