# oii.freq: Frequency tables In oii: Crosstab and Statistical Tests for OII MSc Stats Course

## Description

This function prints a simple frequency table with totals and percentages

## Usage

 `1` ```oii.freq(x) ```

## Arguments

 `x` input variable, (usually of class `factor`)

## Value

A `data.frame` with one row per each unique value of `x`. These values of `x` are assigned to the `row.names` of the data.frame. The data.frame also has rows for:

 `Valid Total` The total number of non-missing cases (i.e., `sum(!is.na(x))`) `Missing` The total number of missing/NA cases (i.e., `sum(is.na(x))`) `Total` The total number of cases (i.e., `length(x)`)

The data.frame has the following columns:

 `freq` The number of cases with this value `percent` The percentage of all cases that this value represents `valid_percent` The percentage of all valid (i.e., not missing) cases that this value represents `cum_percent` The cumulative percentage of valid cases

`data.frame`, `row.names` `is.na`, `length`, `summary`, `table`
 ```1 2 3 4 5``` ```#Create var as 200 A's, B's, and C's var<-sample(LETTERS[1:3],size=200,replace=TRUE) #Generate a frequency table for the counts of A's, B's, and C's oii.freq(var) ```