[R] Plot for jump point

From: kate <yhsu6_at_uiuc.edu>
Date: Sun, 30 Mar 2008 16:17:15 -0500


 My code is as the following,
for (i in 1:length(ratio) )
payoff1<-100*(ratio[i]>=0.7)+max(100*(1+(ratio[i]-1)*2),0)*(ratio[i]<0.7) payoff<-c(payoff,payoff1)
plot(ratio,payoff, xlab='ST/S0', ylab='Payoff',type='l')

I have the discontinuous point at ratio=0.7. I do not want to have the line at 0.7, and would like a solid dot at payoff=100 and a hollow dot at payoff=40 at the jump point 0.7. How would I do this?



        [[alternative HTML version deleted]]

R-help_at_r-project.org mailing list
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. Received on Sun 30 Mar 2008 - 21:26:15 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sun 30 Mar 2008 - 22:30:26 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive