I have the following atomic vectors:
Atom_1
Size Square Standard_Deviation
10 0.20 0.56
20 0.40 0.36
30 0.34 0.50
40 0.26 0.33
Atom_2
Size Square Standard_Deviation
10 0.20 0.56
20 0.40 0.36
30 0.34 0.50
40 0.26 0.33
I plot the graph using,
plot(Atom_1, col="red")
points(Atom_2, col="blue")
But how can I add error bars with corresponding Standard deviation column of the atomic vectors?
I tried solution in: Add error bars to show standard deviation on a plot in R
d = data.frame(
x <- as.numeric(Atom_1[, 1])
, y <- as.numeric(Atom_1[, 2])
, sd <- as.numeric(Atom_1[, 3])
)
plot(d$x, d$y, type="n", ylim = c(0, 10))
with (
data = d
, expr = errbar(x, y, y+sd, y-sd)
)
But it displayed nothing. How can I add Atom_2 plot with it as well?
Note: My previous question was not clear, so I deleted to make this clear one.