combineCols | R Documentation |
Combine columns of a list/data frame into a list by row
combineCols(x, cols = NULL, by_name = FALSE, parallel = FALSE, cores = 1)
x |
A list or data frame. |
cols |
An optional vector of column positions or names to combine together. If passing column names, set by_name to TRUE. The order of items in cols determines the order of the combined result. |
by_name |
Boolean, if TRUE, it quotes the items in cols to properly index the list by name (x[[1]] vs x[["col_a"]]). |
parallel |
Boolean, if TRUE, attempts to use mclapply. |
cores |
An integer, the number of cores to use if parallel is TRUE. |
A list of the values in each column combined together for each row.
combineCols(list("x" = c(1, 2, 3), "y" = c("a", "b", "c")))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.