These are helper function used in the formula interface of varComp
and varComp.test
. They either sort or split the formula terms involving ":".
1 2 3  callList2terms(cl)
splitTerm(term)
sortTerm(term, priority)

cl 
A list converted from a call. 
term 
A character scalar of a formula term to be reordered alphanumerically with respect to the components separated by ":". 
priority 
A character vector whose elements have higher priority to be ordered to the front of the term. 
The main use of sortTerm
is to transform an interaction term like "B:A" into ordered form "A:B" such that redundant terms are easier to be identified. The results will depend on the system locale.
callList2terms
returns a character vector of individual terms (possibly with duplicates). splitTerm
returns a character vector of unique individual components in the term
. sortTerm
returns a character scalar with individual components sorted.
Long Qu
stats::formula
1 2 3 4 
Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.