toBindLists: Binding lists

Description Usage Arguments Value Author(s) Examples

View source: R/ToBindLists.R

Description

This function is only used internally to bind vectors, data frames, and lists.

Usage

1

Arguments

x

A vector, data frame or list.

y

Object of the same type as x.

Value

It returns a vector, a data frame or a list depending on x.

Author(s)

Clara Anton Fernandez [email protected]

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Example of how toBindLists works with data frames
x <- data.frame(1:10, ncol = 2)
names(x) <- c('a', 'b')
y <- data.frame(1:20, ncol = 2)
names(y) <- names(x)
j <- toBindLists(x, y)
j

## with vectors
x <- c(1:3)
y <- (8:15)
j <- toBindLists(x, y)
j

## with lists
x <- data.frame(1:10, ncol = 2)
names(x) <- c('a', 'b')
y <- data.frame(1:20, ncol = 2)
names(y) <- names(x)

x <- list(x = x, y = y)

xx <- data.frame(1:10, ncol = 3)
names(xx) <- c('a', 'b')
yy <- data.frame(1:20, ncol = 3)
names(yy) <- names(xx)

y <- list(xx = xx, yy= yy)

j <- toBindLists(x, y)
j

sitree documentation built on July 5, 2017, 9:02 a.m.