splitDfRegex | R Documentation |
Split data frame or matrix using regex on colnames
splitDfRegex(df, patterns, return.remainder = T, names = NULL)
df |
A data frame of matrix |
patterns |
A vector/list of regular expressions. If arguments are named, or items in the vector/list are named, the items in the output list will also be named accordingly |
return.remainder |
Return columns which don't match the given regular expressions? |
A list of data frames or matrices
## Will return a list containing the corresponding names
splitDfRegex(df = contexts, patterns = list(snv = '\\[', indel = '[.]', sv = '[A-Z]{3}'))
## The same output list as above, but without names
splitDfRegex(df = contexts, patterns = list('\\[', '[.]', '[A-Z]{3}'))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.