ltabs: Cross tabulation with labelled variables

View source: R/tables.R

ltabsR Documentation

Cross tabulation with labelled variables

Description

This function is a wrapper around xtabs, adding automatically value labels for labelled vectors if labelled package eis installed.

Usage

ltabs(
  formula,
  data,
  levels = c("prefixed", "labels", "values"),
  variable_label = TRUE,
  ...
)

Arguments

formula

a formula object (see xtabs)

data

a data frame

levels

the desired levels in case of labelled vector: "labels" for value labels, "values" for values or "prefixed" for labels prefixed with values

variable_label

display variable label if available?

...

additional arguments passed to xtabs

See Also

xtabs.

Examples

data(fecondite)
ltabs(~radio, femmes)
ltabs(~radio+tv, femmes)
ltabs(~radio+tv, femmes, "l")
ltabs(~radio+tv, femmes, "v")
ltabs(~radio+tv+journal, femmes)
ltabs(~radio+tv, femmes, variable_label = FALSE)

questionr documentation built on Feb. 16, 2023, 10:14 p.m.