CrossStrata: Crossing several factor variables

Description Usage Arguments Value Examples

View source: R/CalibrateSSB.R

Description

Create new factor variable by crossing levels in several variables

Usage

1
CrossStrata(by, sep = "-", returnb = FALSE, asNumeric = FALSE, byExtra = NULL)

Arguments

by

Dataframe or matrix with several variables

sep

Used to create new level names

returnb

When TRUE an overview of original variabels according to new levels are also retuned.

asNumeric

When TRUE the new variable is numeric.

byExtra

Contains the same variables as by and represents another data set.

Value

a

The new variable

aExtra

New variable according to byExtra

b

Overview of original variabels according to new levels

Examples

1
CrossStrata(cbind(factor(rep(1:3,2)),c('A',rep('B',5)) ))

CalibrateSSB documentation built on Aug. 5, 2020, 1:07 a.m.