Learn R Programming

visStatistics (version 0.1.1)

counts_to_cases: Convert data frame of counts to data frame of cases. data frame must contain a column with frequencies (counts) as generated by as.data.frame from a contingency table

Description

Convert data frame of counts to data frame of cases. data frame must contain a column with frequencies (counts) as generated by as.data.frame from a contingency table

Usage

counts_to_cases(x, countcol = "Freq")

Arguments

x

a data.frame of counts generated from a contingency table.

countcol

character string, name of the column of x containing the counts. Default name of the column is "Freq".

Value

data frame of cases of dimension (total number of counts as sum of "Freq" in x) times 2.

Examples

Run this code
# NOT RUN {
counts_to_cases(as.data.frame(HairEyeColor[,,1]),countcol="Freq")
# }

Run the code above in your browser using DataLab