one_row_per_id: Extract one row per ID from a 'data.frame'

View source: R/table1c.R

one_row_per_idR Documentation

Extract one row per ID from a data.frame

Description

A convenience function to filter a data.frame retaining one row for each unique value of an ID column. Only columns that are invariant (and hence unambiguouse) within each ID level are retained.

Usage

one_row_per_id(data, idcol)

Arguments

data

A data.frame.

idcol

The name or numeric index of the ID column.

Value

A data.frame in which each ID appears in a single row. Only columns that are invariant (and hence unambiguous) within each ID level are retained.

Examples

library(nlme)
one_row_per_id(Phenobarb, "Subject")

certara/table1c documentation built on Oct. 12, 2022, 8:39 a.m.