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

Description Usage Arguments Value See Also Examples

View source: R/misc.utilities.R

Description

compress.data.frame "compresses" a data frame, returning unique rows and a tally of the number of times each row is repeated, as well as a permutation vector that can reconstruct the original data frame. decompress.data.frame reconstructs the original data frame.

Usage

1
2
3

Arguments

x

For compress.data.frame a data.frame to be compressed. For decompress.data.frame a list as returned by compress.data.frame.

Value

For compress.data.frame, a list with three 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

ordering

A vector such that if c is the compressed data frame, c$rows[c$ordering,,drop=FALSE] equals the original data frame, except for row names

rownames

Row names of x

For decompress.data.frame, the original data frame.

See Also

data.frame

Examples

1
2
3
4
5
6
7

statnet.common documentation built on Aug. 16, 2017, 5:04 p.m.