tab: Simplified Crosstabs

View source: R/crosstabs.R

tabR Documentation

Simplified Crosstabs

Description

This function returns a crosstab (tab) on a given data frame, and using simplified calls within the function for two variables, to return the observed and expected frequencies.

Usage

tab(df, var1, var2)

Arguments

df

data frame to read in.

var1

a first grouping variable.

var2

a second grouping variable.

Value

This function returns the observed and expected frequencies of a bivariate relationship between var1 and var2 in data frame df.

Examples

data <- mtcars

tab(data,mpg,cyl)

vannstats documentation built on April 15, 2023, 9:09 a.m.