oneRowPerId: Rearrange dataframe entries such that there is exactly one...

Description Usage Arguments Value Author(s) Examples

View source: R/oneRowPerId.R

Description

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.

Usage

1
oneRowPerId(x, ids)

Arguments

x

dataframe.

ids

character vector.

Value

A dataframe whose rows correspond 1:1 to ids.

Author(s)

W. Huber huber@ebi.ac.uk, Ligia Pedroso Bras ligia@ebi.ac.uk

Examples

1
2
    x = data.frame(ids=I(c("a", "a", "c")), val=11:13)
    oneRowPerId(x, letters[1:3])


cellHTS2 documentation built on May 20, 2017, 10:18 p.m.
Search within the cellHTS2 package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.

Please suggest features or report bugs in the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.