# frequencies: Frequency tables In rosetta: Parallel Use of Statistical Packages in Teaching

## Description

Function to show frequencies in a manner similar to what SPSS' "FREQUENCIES" command does. Note that `frequency` is an alias for `freq`.

## Usage

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37``` ```freq( vector, digits = 1, nsmall = 1, transposed = FALSE, round = 1, plot = FALSE, plotTheme = ggplot2::theme_bw() ) ## S3 method for class 'freq' print( x, digits = x\$input\$digits, nsmall = x\$input\$nsmall, transposed = x\$input\$transposed, ... ) ## S3 method for class 'freq' pander(x, ...) frequencies( ..., digits = 1, nsmall = 1, transposed = FALSE, round = 1, plot = FALSE, plotTheme = ggplot2::theme_bw() ) ## S3 method for class 'frequencies' print(x, ...) ## S3 method for class 'frequencies' pander(x, prefix = "###", ...) ```

## Arguments

 `vector` A vector of values to compute frequencies for. `digits` Minimum number of significant digits to show in result. `nsmall` Minimum number of digits after the decimal point to show in the result. `transposed` Whether to transpose the results when printing them (this can be useful for blind users). `round` Number of digits to round the results to (can be used in conjunction with digits to determine format of results). `plot` If true, a histogram is shown of the variable. `plotTheme` The ggplot2 theme to use. `x` The `freq` or `frequencies` object to print. `...` For `frequencies`, the variables of which to provide frequencies; for the `print` methods, additional arguments are passed on to the `print` function. `prefix` The prefix to use when printing `frequencies`, to easily prepend Markdown headers.

## Value

An object with several elements, the most notable of which is:

 `dat` A dataframe with the frequencies

For `frequencies`, these objects are in a list of their own.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```### Create factor vector ourFactor <- factor(mtcars\$gear, levels=c(3,4,5), labels=c("three", "four", "five")); ### Add some missing values factorWithMissings <- ourFactor; factorWithMissings <- factorWithMissings <- NA; ### Show frequencies freq(ourFactor); freq(factorWithMissings); ### ... Or for all of them at one frequencies(ourFactor, factorWithMissings); ```

rosetta documentation built on Nov. 14, 2021, 1:06 a.m.