util_rbindlist: Safely 'rbind' multiple data.frames

Description Usage Arguments Value Examples

View source: R/nhl_utils.R

Description

Attempts to replace do.call(rbind, lst) taking into consideration that some data frames in lst can have missing columns. Those are filled by NA values.

Usage

1
util_rbindlist(lst, fill = TRUE)

Arguments

lst

list(), of data frames to be rbind-ed into one.

fill

logical(1), if FALSE, this function just returns do.call(rbind, lst).

Value

data.frame, the elements of lst, rbind-ed into one.

Examples

1
2
3
4
  nhlapi:::util_rbindlist(list(
    datasets::mtcars[1, 2:3],
    datasets::mtcars[2, 4:5]
  ))

nhlapi documentation built on Feb. 20, 2021, 9:06 a.m.