Changing color and shape of point in time series plot depending on value of different variable in r -


I have time series in which there are possibilities for simplicity, imagine each point that on an approximate day this rain in New York Will or not? When I plot a series of times, I would like the symbol pch = 1 and col = "green" if I was right and if I was wrong, then I would like to use pch = 4 and col = "red" I am

I have tried and failed in some ways. Mainly I am using chart. The Time Series Function in PerformanceAnalytics is open to ideas

I have tried to plot a series in which there is a right and wrong representation of vectors' peaches and cholera. I have tried to plot just the right points and have used the points to add wrong actions.

Thanks

I will try to guess what I am asking you to do. First, create a set of predictions each day for a few months and decide that your prediction was correct:

  df < - data.frame (days = 1:31, p_rain = runif (31), true = sample (C, TRUE, FALSE, 31, T))  

No, they make their symbols and colors based on:

  df $ ppch & lt; - # 1 Default DF $ PPP [DF $ right == Wrong] <4 / When you were wrong  

Similarly,

  df $ pcolor & Lt; - as.character ('green') df $ pcolor [df $ true == false]  - 'red'  

Now plot:

(DF, plot (day, p_rain, pch = ppch, col = pcolor))


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -