tab | R Documentation |
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.
tab(df, var1, var2)
df |
data frame to read in. |
var1 |
a first grouping variable. |
var2 |
a second grouping variable. |
This function returns the observed and expected frequencies of a bivariate relationship between var1
and var2
in data frame df
.
data <- mtcars
tab(data,mpg,cyl)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.