Skip to contents

S3 method for the + operator for objects of class "procr_varformat". Combines two variable formatting objects by adding their formulas using a custom operator and concatenating their variable definitions.

Usage

# S3 method for class 'procr_varformat'
x + y

Arguments

x

A procr_varformat object.

y

A procr_varformat object.

Value

A new procr_varformat object with:

formula

The combined formula x$formula %_+_% y$formula.

variables

A concatenated list of the variables from x and y.

Examples

fmt1 <- new_format(Sepal.Length > 5 ~ "long", var = Sepal.Length)
fmt2 <- new_format(Sepal.Width > 3 ~ "wide", var = Sepal.Width)
combined_fmt <- fmt1 + fmt2