Re: [R] How would I color points conditional on their value in a plot of a time series

2018-05-02 Thread Martin Maechler
> Eivind K Dovik > on Tue, 1 May 2018 23:18:51 +0200 writes: > You may also want to check this out: > plot(ttt, type = "p") > points(ttt, col = ifelse(ttt < 8, "black", "red")) > Eivind K. Dovik > Bergen, NO yes, indeed, or -- even nicer for a time series: usin

Re: [R] How would I color points conditional on their value in a plot of a time series

2018-05-01 Thread Eivind K. Dovik
You may also want to check this out: plot(ttt, type = "p") points(ttt, col = ifelse(ttt < 8, "black", "red")) Eivind K. Dovik Bergen, NO On Tue, 1 May 2018, Christopher W Ryan wrote: Excellent! Worked like a charm. Thanks. --Chris Ryan On Tue, May 1, 2018 at 4:33 PM, William Dunlap wrote

Re: [R] How would I color points conditional on their value in a plot of a time series

2018-05-01 Thread Christopher W Ryan
Excellent! Worked like a charm. Thanks. --Chris Ryan On Tue, May 1, 2018 at 4:33 PM, William Dunlap wrote: > The ts method for plot() is quirky. You can use the default method: > > plot(as.vector(time(ttt)), as.vector(ttt), type = "p", col=ifelse(ttt<8, > "black", "red")) > > > Bill Dunlap >

Re: [R] How would I color points conditional on their value in a plot of a time series

2018-05-01 Thread William Dunlap via R-help
The ts method for plot() is quirky. You can use the default method: plot(as.vector(time(ttt)), as.vector(ttt), type = "p", col=ifelse(ttt<8, "black", "red")) Bill Dunlap TIBCO Software wdunlap tibco.com On Tue, May 1, 2018 at 1:17 PM, Christopher W Ryan wrote: > How would I color points con

[R] How would I color points conditional on their value in a plot of a time series

2018-05-01 Thread Christopher W Ryan
How would I color points conditional on their value in a plot of a time series. Something like this: ## demonstration data ttt <- ts(rpois(12, lambda = 8), start = c(2000, 1), freq = 4) ttt plot(ttt, type = "p") ## doesn't work--all points the same color plot(ttt, type = "p", col = ifelse(ttt <