Learn R Programming

StatMethRank (version 1.3)

freq2case: Convert frequency table to raw data

Description

Convert frequency table to raw data(case form). This is a useful function to convert the data written by Michael Friendly.

Usage

freq2case(x, var.names = NULL, freq.name = "Freq", freq.col = NULL, ...)

Arguments

x
A table object, or a data frame in frequency form containing ranks and one numeric variable representing the frequency for that rank.
var.names
A list of variable names for the factors, if you wish to override those already in the table.
freq.name
The name of the frequency variable in the table.
freq.col
The column index of the frequencies.
...
Other arguments passed down to type.convert.

Value

  • A data frame containing the factors in the table and as many observations as are represented by the total of the freq variable.

References

Posted on R-Help, Jan 20, 2009. http://tolstoy.newcastle.edu.au/R/e6/help/09/01/1873. html

Examples

Run this code
data(APA)
cases = freq2case(APA, freq.col = 1)
freqs = case2freq(cases)

Run the code above in your browser using DataLab