This function splits a function based on + or - terms
It uses the parser and does not disturb terms within other functions. For example:
rxSplitPlusQ(x, level = 0, mult = FALSE)
x
: Quoted R expression for splittinglevel
: Internal level of parsingmult
: boolean to split based on * and / expressions instead. By default this is turned off.character vector of the split expressions
aexp(b+c)+dlog(e-f)-g*f
would return
c("a * exp(b + c)", "d * log(e - f)", "- g * f")
Matthew L. Fidler
Useful links