safeRowBindOfListElements: row-bind data frames in a list of lists

View source: R/dataFrame.R

safeRowBindOfListElementsR Documentation

row-bind data frames in a list of lists

Description

row-bind data frames in a list of lists

Usage

safeRowBindOfListElements(x, elementName)

Arguments

x

list of lists each of which contains a data frame in element elementName

elementName

name of list element in each sublist of x which contains a data frame

Value

data frame resulting from "row-binding" data frames.

Examples

x <- list(
  list(
    number = 1,
    data = data.frame(x = 1:2, y = 2:3)
  ),
  list(
    number = 2,
    data = data.frame(x = 11:12, y = 12:13)
  )
)
  
safeRowBindOfListElements(x, "data")
  
# also working if the column names of the data frames in the "data" elements
# differ.
x[[1]]$data$z = 13:14
safeRowBindOfListElements(x, "data")


KWB-R/kwb.utils documentation built on April 1, 2024, 7:12 a.m.