I think this is what you are getting at. Hope this helps.
#index data to determine what low and high levels of tvHrs are (I said
anything over 15 hours is considered 'high')
index=which(tvHrs > 15)
#Plot the first plot, which is the 'high', only using values from crimeDvp
that are in 'index' (corresponding to high levels of tvHrs
plot(prop.table(table(crimeDvp[index])),type='b',ylab='percent',xlab='crime
dev',col='red')
lines(prop.table(table(crimeDvp[-index])),type='b', col='black')
lines(prop.table(table(crimeDvp)),type='b',col='green')
legend("topright", inset=.05, title="TV consume", c("high","low","all"),
fill=c('red','black','green'))
--
View this message in context:
http://r.789695.n4.nabble.com/Multiple-line-plot-tp4394539p4395262.html
Sent from the R help mailing list archive at Nabble.com.
______________________________________________
[email protected] 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.