var_cross: Cross or interact two variables

View source: R/var_cross.R

var_crossR Documentation

Cross or interact two variables

Description

Create a new variable which is an interaction of two other variables. Also see tab_cross().

Usage

var_cross(newvr, vr, vrby)

Arguments

newvr

name of the new variable to be created

vr

first variable

vrby

second variable

Value

Survey object

See Also

Other variables: var_all(), var_any(), var_case(), var_collapse(), var_copy(), var_cut(), var_not()

Examples

set_survey(namcs2019sv)
var_cross("Age x Sex", "AGER", "SEX")
tab("Age x Sex")

surveytable documentation built on Aug. 26, 2025, 1:07 a.m.