I would like to plot two different samples on the same scatterplot in R using different symbols for the different groups. Could someone please let me know how this can be done? Thank you very much. Thad ***************************************************************************** Thaddeus Tarpey Phone: (937) 775-2861 Wright State University Fax: (937) 775-2081 Department of Mathematics and Statistics Dayton, Ohio 45435 Home-page: http://www.math.wright.edu/People/Thad_Tarpey/thad.htm ***************************************************************************** -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thaddeus Tarpey <thaddeus.tarpey at wright.edu> writes:> I would like to plot two different samples on the same scatterplot in R > using different symbols for the different groups. > Could someone please let me know how this can be done?One way is to use the pch argument to the plot function, as in > library(MASS) > data(michelson) > plot(Speed ~ as.integer(Run), data = michelson, pch = as.integer(Expt)) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Thad, Here is an example taken from a class I am teaching: library(MASS); data(Cars93) plot(Cars93$EngineSize,Cars93$Horsepower,col=as.numeric(Cars93$Type)) Chong -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._