[R] How to plot error bars

Uwe Ligges ligges at statistik.uni-dortmund.de
Wed Nov 8 18:31:34 CET 2000


On Wed, 8 Nov 2000, Mike Beddo wrote:

> I'm a newcomer to R. I can't seem to find any documentation how to add
> error bars to points in scatter plots. I guess I could plot the points,
> then compute and plot line segments in the X and/or Y directions to
> represent the errors?

You are right.
You can plot the points, fit a model (e.g. using lm()), and plot the
"error bars" or residuals. Have a look at e.g. str(lm(...)), maybe you
don't need to calculate fitted values / residuals manually.
In some cases there are already existing plot methods ...

Finally: To plot line segments you might want to use segments().

Regards,
Uwe Ligges

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list