xtabs requires two arguments (na.action and exclude) to show missing values along with other values. This function defaults to including missings and has only one argument

crosstabs(x, ..., exclude = NULL)

Arguments

x

passed to xtabs if it is a formula, transformed into a formula if it's a single object

...

passed to xtabs

exclude

defaults to NULL (i.e. includes NA)

Examples

x = NA crosstabs(~ x)
#> x #> <NA> #> 1