[R] R plotting

Mubar simon.keusen at student.unisg.ch
Fri Oct 11 14:45:47 CEST 2013


I have a question regarding plots in R. I have data from the S&P 500 in the

date           close     change
1980-01-07  109.92   3.4

I plotted the data with plot(spdata$date, log(spdata$close), type="p")

Now I want to ad the colors green and red to the data frame. if the change
is positive it should be green, if negative, red. Also the colors should be
in the plot. I tried to do this with the ifelse function, but seem to be

Can anyone help me with this?

Thanks a lot!

View this message in context: http://r.789695.n4.nabble.com/R-plotting-tp4678056.html
Sent from the R help mailing list archive at Nabble.com.

More information about the R-help mailing list