On 2010-07-05 23:05, Gundala Viswanath wrote:
Dear Expert,

I have a data that looks like this:

for_y_axis<-c(0.49534,0.80796,0.93970,0.99998)
for_x_axis<-c(1,2,3,4)
count<-c(0,33,0,4)

What I want to do is to plot the graph using "for_x_axis" and
"for_y_axis" but will mark
each point with "o" if the value is equal to 0(zero) and with "x" if
the "count" value is greater than zero.

Is there a simple way to achieve that in R?

Here's one way:

 .pch <- ifelse(count > 0, "x", "o")
 plot(for_x_axis, for_y_axis, pch = .pch)

or you might prefer

 plot(for_x_axis, for_y_axis, pch = .pch, family = "mono")


  -Peter Ehlers

______________________________________________
R-help@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.

Reply via email to