R/dtFillObs.R

Defines functions dtFillCols

Documented in dtFillCols

##' Create a data table with columns of unequal length
##'
##' @param ... Vectors to put into data.table
##'
##' @keywords internal


dtFillCols <- function(...){

    dots <- list(...)

    length.max <- max(sapply(dots,length))

    dots <- lapply(dots,function(x)c(x,rep(NA,length.max-length(x))))
    do.call(data.table,dots)
    
}

Try the NMdata package in your browser

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

NMdata documentation built on Nov. 5, 2025, 5:43 p.m.