If you want it in b*x+a form then just:
if (coef(m)[2] >= 0) {
eq <- substitute(italic(y) ==
b %.% italic(x) + a*","~~italic(r)^2~"="~r2, l)
} else {
eq <- substitute(italic(y) ==
- b %.% italic(x) + a *"," ~~ italic(r)^2 ~"="~r2, l)
}
Writing R expressions requires understanding that there is a syntax rule: token/separator/token, but you can use either "+" or "-" as a unary separator. The upper portion of the plotmath symbol table in ?plotmath has the acceptable separators. Spaces and linefeeds get ignored.