Re: [R] rlm results on trellis plot

From: hadley wickham <>
Date: Fri, 08 Jun 2007 16:25:17 +0200

On 6/7/07, Alan S Barnett <> wrote:
> How do I add to a trellis plot the best fit line from a robust fit? I
> can use panel.lm to add a least squares fit, but there is no panel.rlm
> function.

It's not trellis, but it's really easy to do this with ggplot2:

install.packages("ggplot2", dep=T)

p <- qplot(x, y, data=diamonds)

p + geom_smooth(method="lm")
p + geom_smooth(method="rlm")
p + geom_smooth(method="lm", formula="y ~ poly(x,3)")

see for more examples.

Hadley mailing list PLEASE do read the posting guide and provide commented, minimal, self-contained, reproducible code. Received on Fri 08 Jun 2007 - 15:24:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Fri 08 Jun 2007 - 15:31:54 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.