R/tidyHtmlTable_helpers_bindDataListIntoColumns.r

Defines functions prBindDataListIntoColumns

Documented in prBindDataListIntoColumns

#' 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()
}

Try the htmlTable package in your browser

Any scripts or data that you put into this service are public.

htmlTable documentation built on Nov. 2, 2023, 6:26 p.m.