I have a problem where I have two columns of data that I can simply plot using:
plot(wV[0:15,3],wY[0:15,3]). This produces my desired plot. Now, say I have a third variable that I would like to introduce and use that variable to set different colors in the plot In this case, say I wanted values greater than 0 to be "blue" and values less than 0 to be "red" Basically, my question is how can one plot something like the function shown above, but with the added functionality of indicating color for a third variable Something to the effect: if(weightComply[0:15,3]>0) //if the values from 0 to 15 in column 3 are greater than 0 plot(wV[0:15,3],wY[0:15,3],col="blue") //then plot the dots as blue else plot(wV[0:15,3],wY[0:15,3],col="red") //otherwise plot the dots red I know this syntax is wrong, but I think it shows what I generally want to do. Mark ______________________________________________ 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.