formula2string {cwhstring} | R Documentation |
formula2string
Returns the left and the right hand sides of a
formula.
formula2term.names
Returns one chosen side of a
formula.
formula2Rterm.names
Returns the right hand side of a
formula.
formula2string(form) formula2term.names(form,side) formula2Rterm.names(form)
form |
a formula. |
side |
one of "left","right". |
formula2string
: Character vector containing the string
representation of the formulas side(s).
uses strsplit
Christian W. Hoffmann, christian.hoffmann@wsl.ch, http://www.wsl.ch/staff/christian.hoffmann
The inverse function to formula2string
is str2formula
.
formula2string(a ~ b + c) # $left: "a" $right: "b+c" formula2string(~ b + c) # $left: "" $right: "b+c" formula2string(a ~ .) # $left: "a" $right: "." formula2term.names(a ~ b1 + c,"left") # "a" formula2Rterm.names(a ~ b1 + c) # "b1" "c"