The functions is.formula()
,
is.one.sided()
, has.nested.terms()
,
has.cbind.terms()
, has.crange.terms()
,
in.formula()
and sub.formulas()
performs checks or extract sub-formulas from a given formula.
is.formula(frm)
is.one.sided(frm)
has.nested.terms(frm)
has.cbind.terms(frm)
has.crange.terms(frm)
in.formula(frm, whatsym)
sub.formulas(frm, head)
a formula;
a symbol to search in the formula;
the beginning of a sub-formula to extract
is.formula(frm)
, has.nested.terms(frm)
,
has.crange.terms(frm)
and has.cbind.terms(frm)
returns TRUE if frm is a formula, contains a |
or a
crange
or a cbind
respectively;
in.formula(frm, whatsym)
returns TRUE if the symbol whatsym
is somewhere in 'frm';
sub.formulas(frm, head)
returns a list of all the sub-formulas which contains head
.
These formulas are for internal use.
is.formula( Frequency ~ Intensity * Pitch )
#> [1] TRUE
has.nested.terms( Level ~ Factor | Level )
#> [1] TRUE
has.cbind.terms( Frequency ~ cbind(Low,Medium,High) * cbind(Soft, Hard) )
#> [1] TRUE
has.crange.terms( Frequency ~ crange(Low,High) * cbind(Soft, Hard) )
#> [1] TRUE
in.formula( Frequency ~ Intensity * Pitch, "Pitch" )
#> [1] TRUE
sub.formulas( Frequency ~ cbind(Low,Medium,High) * cbind(Soft, Hard), "cbind" )
#> [[1]]
#> cbind(Low, Medium, High)
#>
#> [[2]]
#> cbind(Soft, Hard)
#>