Learn R Programming

jmvcore (version 0.8)

constructFormula: Construct a formula string

Description

Construct a formula string

Usage

constructFormula(dep = NULL, terms)

Arguments

dep

the name of the dependent variable

terms

list of character vectors making up the terms

Value

a string representation of the formula

Examples

Run this code
# NOT RUN {
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