| oneRowPerId {cellHTS} | R Documentation |
Rearrange dataframe entries such that there is exactly one row
per ID. The IDs are taken from the argument ids and are matched
against the first column of x. If an ID is missing in x[,1],
a row with NA values is inserted. If an ID occurs multiple times
in x[,1], rows are collapsed into characters of comma-separated values.
oneRowPerId(x, ids)
x |
dataframe. |
ids |
character vector. |
A dataframe whose rows correspond 1:1 to ids.
W. Huber huber@ebi.ac.uk, Ligia Pedroso Bras ligia@ebi.ac.uk
x = data.frame(ids=I(c("a", "a", "c")), val=11:13)
oneRowPerId(x, letters[1:3])