Learn R Programming

statnet.common (version 3.2.3)

compress.data.frame: "Compress" a data frame

Description

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

Usage

compress.data.frame(x)

Arguments

x
A data frame.

Value

  • A list with two elements:
  • rowsUnique rows of x
  • frequenciesA 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

Run this code
data(faithful)

head(faithful)

lapply(compress.data.frame(faithful),head)

Run the code above in your browser using DataLab