Hello Everyone-
I'm in the process of slowly learning R and am having a little bit of trouble plotting an extra line onto a scatterplot. I'm sure the answer is quite simple but I am stumped.

The code I am using is:

headways <- read.table("headways.csv", header=TRUE, sep=",", na.strings="", dec=".", strip.white=TRUE)
plot.new()
scatterplot(dechway~dechr, reg.line=FALSE, smooth=TRUE, labels=F, boxplots='y', span=0.5, xlab="Time", ylab="Headway", ylim=c(0,9), data=headways)
lines(headways$dechr, headways$schedule)

A subset of the dataset I'm working with is at http://web.mit.edu/c64/www/headways.csv .

The extra line, plotted with lines(), should be right at 4, but is actually below where it should be. I assume that I'm using the wrong function to plot this line, as there are many ways to do it, but have not the experience to know which function is appropriate to use with scatterplot().

Thank you for all of your help.
-Tony

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to