[R] using by to plot

David White dwhite at ling.ohio-state.edu
Tue Aug 28 17:14:37 CEST 2001



Hello,

I would like to use by to create a series of plots, but I'm not sure how
to design the function.

Here's what I've got:

1. A data frame of observations of measured value 2 measured vlaues and a
pch code.

V1    V2   pchCode
.0045 123  1
.0034 145  2
.0045 123  1
.0046 167  3
...

So what I want to do is create a single scatterplot of the multiple
conditions (specified by pchCode) and use pchCode to specify the plotting
character within the plotting function.

I'm imagining something like

by(df, pchCode, function(x) plot(V1, V2, pch=pchCode))

What I don't know how to code is:
1. getting the pch to be defined by the pchCode
2. specifying that par(new=TRUE) within the by command.

Thanks for you suggestions,

Best,

David


S. David White
sdavidwhite at bigfoot.com
Columbus, Ohio

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list