Learn R Programming

rpf (version 1.0.14)

compressDataFrame: Compress a data frame into unique rows and frequencies

Description

Compress a data frame into unique rows and frequency counts.

Usage

compressDataFrame(tabdata, freqColName = "freq", .asNumeric = FALSE)

Value

Returns a compressed data frame

Arguments

tabdata

An object of class data.frame

freqColName

Column name to contain the frequencies

.asNumeric

logical. Whether to cast the frequencies to the numeric type

Examples

Run this code
df <- as.data.frame(matrix(c(sample.int(2, 30, replace=TRUE)), 10, 3))
compressDataFrame(df)

Run the code above in your browser using DataLab