> On 30 May 2017, at 19:02, Tobias Christoph <s3toc...@uni-bayreuth.de> wrote: > > Hey Guys, > > I just try to differentiate certain values in my plot by colour or symbol. > > I have panel data with three dimensions (number of stations, revenue, > years). To integrate the third dimension (years) in the plot, I want to > differentiate the values(number of stations, revenue) by a certain range > of years. > > e.g.: 2005-2010: red coloured dots, 2011-2016, blue coloured dots > > For the normal plot I used the following formula: > > *plot(data$stations, data$revenue, xlab="stations", ylab="revenue")* > > I only found a way to mark every single year. So hopefully you can help? > > Cheers, > > Toby >
See ?findInterval. Especially, first 3 lines in _Examples_ section. Use result of findInterval as argument to _col_ or _pch_ in plot function. ______________________________________________ R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see 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.