#' Combine cells from table
#'
#' Iterate over each column of the table and select the cells (via row) to create a combination/permutation.
#'
#' @param table Either a data frame or matrix, whose cells we wish to combine.
#' @param selection A numeric vector determining the combination/permutation.
#' @return A combination/permutation of cells selected from each column.
#' @export
select_combinatorial_rows_from_table = function(selection, table){
if(!length(selection)==ncol(table)){
stop("The lenght of selection must be the same as count of columns in table.")
}
o = c()
for(i in 1:length(selection)){
o = c(o, table[selection[i],i])
}
return(o)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.