[R] Multiple line-plot

Dallas tad.dallas at drakeresearchlab.com
Thu Feb 16 20:43:21 CET 2012


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.



More information about the R-help mailing list