R/split_table_byCol_into_equal_chunks.R

Defines functions split_table_byCol_into_equal_chunks

Documented in split_table_byCol_into_equal_chunks

#' Split table by columns into chunks 
#' 
#' NOTE: The output chunks may not be of equal count of columns, as any reminder of columns COULD be part of last chunk.
#' 
#' @param table Matrix or data frame we wish to split.
#' @param n Integer of desired count of chunks.
#' @return List of 
#' @export 

split_table_byCol_into_equal_chunks = function(table,n){
  colNames = colnames(table)
  colNames_portions = split_vector_into_equal_chunks(colNames,n=n)
  o = list()
  for(i in 1:n){
    colPerIter = colNames_portions[[i]]
    o = lappend(o, table[,colPerIter])
  }
  o
}
msxakk89/dat documentation built on Aug. 3, 2020, 6:39 p.m.