[R] error bars in line plots

Frank E Harrell Jr fharrell at virginia.edu
Mon Oct 7 13:58:58 CEST 2002


On Mon, 7 Oct 2002 09:23:08 +0200 (CEST)
Ott Toomet <siim at obs.ee> wrote:

> On 6 Oct 2002, Myriam Abramson wrote:
> 
>   |Hi!
>   |
>   |Could you tell me how I can draw a graph with error bars? 
>   |Sorry, I don't use R that often and I couldn't find it easily in the
>   |documentation. 
> 
> There is no errorbars function in the package.  But you may easily construct
> your own using segments().  I add my own versions below (actually, why not
> put something similar into the base package?).
> 
> You may use it as:
> plot(x,y)
> errorbars(x,y, dy=dy)
> 
> The second function is for using with matplot().
> 
> Ott
> 
> -----------------------
> 
> errorbars <- function(x, y, dy=NULL, dx=NULL, ...) {

. . .

Also look at errbar and xYplot in the Hmisc library.  -Frank Harrell
-- 
Frank E Harrell Jr              Prof. of Biostatistics & Statistics
Div. of Biostatistics & Epidem. Dept. of Health Evaluation Sciences
U. Virginia School of Medicine  http://hesweb1.med.virginia.edu/biostat
-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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