R/unlist_col.R

Defines functions unlist_col

Documented in unlist_col

#' Unlist column
#'
#' Unlist a column in a \link[data.table]{data.table}.
#' @param dat \link[data.table]{data.table}
#' @param col Column name.
#' @returns \link[data.table]{data.table}
#'
#' @keywords internal
unlist_col <- function(dat,
                       col){
  dat[rep(dat[,.I],lengths(get(col)))
  ][, eval(col) := unlist(dat[[col]])][]
}
neurogenomics/HPOExplorer documentation built on Aug. 24, 2024, 1:39 a.m.