I'm having difficulty adding some trend lines to a graph.
p<-ggplot(rawdata,aes(V8,V9,color=V9)) + geom_point()
for(i in 1:length(means))
{
p + (geom_segment(aes(x = rawdata[boundary[i],8], y = means[i], xend = rawdata[boundary[i],8], yend = means[i])))
}
Means is a vector containing the means for each different boundary as it iterates through.
I'm not getting any errors, but the segments aren't showing up on the plot.
The script is designed to be scale-able depending on the size of the data set input, hence the for loop.