Here's a dataset to work with.
plot.df <- data.frame(xvariable=1:6, yvariable=1:6+rnorm(6,0,0.3), xpoints=1:6+rnorm(6,0,0.1), ypoints=1:6+rnorm(6,0,0.1))
It IS possible to add multiple geometric objects of the same type to one ggplot. For example:
ggplot(data = plot.df, aes(x = xvariable)) +
geom_line(aes(y = yvariable)) +
geom_point(aes(y=ypoints[1], x=xpoints[1])) +
geom_point(aes(y=ypoints[2], x=xpoints[2])) +
geom_point(aes(y=ypoints[3], x=xpoints[3])) +
geom_point(aes(y=ypoints[4], x=xpoints[4])) +
geom_point(aes(y=ypoints[5], x=xpoints[5])) +
geom_point(aes(y=ypoints[6], x=xpoints[6]))
But that's a pain, and you're rightly seeking to avoid that sort of code replication. The answer depends on what you're looking for. Different formatting for each point? Try this:
ggplot(data = plot.df, aes(x = xvariable)) +
geom_line(aes(y = yvariable)) +
geom_point(data=transform(plot.df, pointsID=as.factor(1:6)),
aes(y=ypoints, x=xpoints, color=pointsID))
You can alter the colors (or choices for other formatting parameters) through calls to scale_colour_discrete and related ggplot components.
PS - Your original strategy failed because ggplot waits until print time to evaluate arguments such as the i in xpoints[i]; even though you see 1 point, you're actually plotting 6 of the same point right on top of one another.