jmvcore (version 2.3.19)

constructFormula: Construct a formula string

Description

Construct a formula string

Usage

constructFormula(dep = NULL, terms)

Value

a string representation of the formula

Arguments

dep

the name of the dependent variable

terms

list of character vectors making up the terms

Examples

Run this code

constructFormula(terms=list('a', 'b', c('a', 'b')))
# a+b+a:b

constructFormula('f', list('a', 'b', c('a', 'b')))
# "f~a+b+a:b"

constructFormula('with spaces', list('a', 'b', c('a', 'b')))
'`with spaces`~a+b+a:b'

Run the code above in your browser using DataLab