freq_ca: Compute Level Frequencies (for a Factor or Vector)

Description Usage Arguments Value Examples

View source: R/svs.r

Description

A helper function for computing the frequency of each factor level (typically used in correspondence analysis).

Usage

1
freq_ca(dat, nfac = FALSE)

Arguments

dat

A factor, (character) vector or a data frame.

nfac

Logical indicating whether the number of factors (i.e. the number of columns in dat) is a divisor for the level frequencies.

Value

A vector containing the frequency counts of every level.

Examples

1
2
3
4
SndT_Fra <- read.table(system.file("extdata", "SndT_Fra.txt", package = "svs"),
   header = TRUE, sep = "\t", quote = "\"", encoding = "UTF-8",
   stringsAsFactors = FALSE)
freq_ca(SndT_Fra)

svs documentation built on Nov. 10, 2020, 1:09 a.m.