R/list_simply.R

Defines functions list_simply

list_simply = function( Z, vn=NULL, returntype="data.frame" ){
  # list of lists to data frame
  if (!is.null(vn)) Z = Z[[vn]] 
  out = data.frame( lapply( Z, function(x) Reduce(c, x)))
  if ( returntype=="data.frame" )  return(out)
  if ( returntype=="data.table" )  return(as.data.table(out))
}
jae0/aegis documentation built on April 4, 2024, 2:40 p.m.