[R] plotting simple plot with error bars

Kenneth Cabrera krcabrer at epm.net.co
Sun Jun 16 17:34:33 CEST 2002



Timur Elzhov wrote:

>Hello!
>
>I'm novice in R, so excuse me if my question will be quite trivial.
>I look through all the demos and examples, but could not find how could I
>plot 'classical' simple graph with error bars.  That is, I have dataframe
>with 3 columns: "x", "y" and "dy" -- how can I get points (x, y) with,
>for example, short lines of length "dy" up and down from "y"?
>
I have a very crude solution....


attach(dataframe)
plot(x,y)
for (i in 1:length(x)) { lines(c(x[i],x[i]),c(y[i]-dy[i],y[i]+dy[i])) }


I hope it will helps


>
>Thanks.
>
>
>Timur.
>
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>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
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
>


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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