File: tidyHtmlTable_helpers_bindDataListIntoColumns.r

package info (click to toggle)
r-cran-htmltable 2.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,600 kB
  • sloc: javascript: 6,797; makefile: 2
file content (14 lines) | stat: -rw-r--r-- 455 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#' Merge columns into a tibble
#'
#' Almost the same as [tibble::tibble()] but it solves the issue
#' with some of the arguments being columns and some just being vectors.
#'
#' @param dataList `list` with the columns/data.frames
#' @return `data.frame` object
prBindDataListIntoColumns <- function(dataList) {
  stopifnot(is.list(dataList))
  dataList %>%
    purrr::keep(~ !is.null(.)) %>%
    do.call(dplyr::bind_cols, .) %>%
    tibble::as_tibble()
}