[R] Scatter Plot Command Syntax Using Data.Frame Source

Rich Shepard rshepard at appl-ecosys.com
Wed Aug 31 22:50:43 CEST 2011


   I've tried various commands. ?plot, Teetor's book, "R Cookbook", and
Mittal's book, "R Graphs Cookbook" without seeing how to write the command
to create scatterplots from my data.frame. The structure is:

> str(chemdata)
'data.frame':	14886 obs. of  4 variables:
  $ site    : Factor w/ 148 levels "BC-0.5","BC-1",..: 104 145 126 115 114
128 124 2 3 3 ...
  $ sampdate: Date, format: "1996-12-27" "1996-08-22" ...
  $ param   : Factor w/ 8 levels "As","Ca","Cl",..: 1 1 1 1 1 1 1 1 1 1 ...
  $ quant   : num  0.06 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 0.01 ...

   and what I'd like to do is create scatter plots of quant (y-axis) against
the factor site (x-axis) for specified param factors. Teetor has an example
for a data set with two numeric variables and a single factor. I have a
single numeric veriable, two factors, and a date.

   I'll also want to create time series line plots of values as a function of
date for specified params.

   If the data.frame had only two columns all the examples work. But, using
two columns (the number per site factor for only a specified param factor)
is not covered in what I've read so far.

   Other graphing resources about which I should know?

Rich



More information about the R-help mailing list