uncollapse | R Documentation |
Uncollapse data.table cols
uncollapse(dt, ..., sep = ";")
recollapse(dt, by, sep = ";")
dt |
data.table |
... |
cols |
sep |
string |
by |
string |
# Example data
(dt <- data.table::data.table(
uniprot = 'Q9BQL6;Q96AC1;Q96AC1-3',
protein = 'FERM1_HUMAN;FERM2_HUMAN',
gene = 'FERMT1;FERMT2',
family = 'FERM'))
# Uncollapse
uncollapse(dt, protein, gene, sep = ';')
recollapse( uncollapse(dt, protein, gene, sep = ';'), by = 'uniprot')
# Unchanged when no sep
uncollapse(dt, family, sep = ';')
uncollapse(dt, family, sep = 'NOSEP')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.