"Compress" a data frame

Share:

Description

This function "compresses" a data frame, returning unique rows and a tally of the number of times each row is repeated

Usage

1

Arguments

x

A data frame.

Value

A list with two elements:

rows

Unique rows of x

frequencies

A vector of the same length as the number or rows, giving the number of times the corresponding row is repeated

See Also

data.frame

Examples

1
2
3
4
5