interactionWithMissing: Get interaction variable between different variables.

View source: R/miscellaneous.R

interactionWithMissingR Documentation

Get interaction variable between different variables.

Description

This ensures that missing values in one of the variable(s) don't propagate, so the combined result will be: 'NA - a', and that the levels of the combined vector are sorted as the levels of the specified variables (levels of the first variable varying first).

Usage

interactionWithMissing(data, vars, varSep = " - ")

Arguments

data

Data.frame with data.

vars

Character vector with variable(s) of interest.

varSep

String with separator to which the variable(s) should be combined.

Value

Vector of length: nrow(data), with interaction vector.

Author(s)

Laure Cougnaud


patientProfilesVis documentation built on Nov. 18, 2022, 5:12 p.m.