[R] Syntax Help for xyplot()

Rich Shepard rshepard at appl-ecosys.com
Mon Oct 24 22:49:16 CEST 2011


   Thanks to David's help I subset my large data set and produced a smaller
one for a single stream and 7 factors of interest. The structure of this
data frame is:

str(burns.tds.anal)
'data.frame':	718 obs. of  4 variables:
  $ site    : Factor w/ 143 levels "BC-0.5","BC-1",..: 1 1 4 6 4 4 4 5 5 5
  $ sampdate: Date, format: "1996-06-02" "1996-06-02" ...
  $ param   : Factor w/ 7 levels "Ca","Cl","Cond",..: 6 7 3 6 3 3 3 3 3 3
  $ quant   : num  194 530 826 36 848 ...

and a summary of it shows:

summary(burns.tds.anal)
       site        sampdate           param         quant
  BC-3   :460   Min.   :1992-03-27   Ca  : 65   Min.   :   1.00
  BC-2   :107   1st Qu.:1994-09-21   Cl  :148   1st Qu.:  14.03
  BC-1   : 62   Median :1996-05-21   Cond: 94   Median :  64.40
  BC-4   : 38   Mean   :1998-11-19   Mg  : 65   Mean   : 189.47
  BC-1.5 : 28   3rd Qu.:2002-10-31   Na  : 34   3rd Qu.: 285.75
  BC-0.5 : 12   Max.   :2011-05-18   SO4 :155   Max.   :2058.00
  (Other): 11                        TDS :157   NA's   :   8.00

a sample of the data in burns.tds.anal is:

  burns.tds.anal
         site   sampdate param   quant
82    BC-0.5 1996-06-02   SO4  194.00
83    BC-0.5 1996-06-02   TDS  530.00
6903    BC-2 1994-07-25  Cond  826.00
6905    BC-4 1996-08-23   SO4   36.00
6977    BC-2 1994-10-19  Cond  848.00
6980    BC-2 1995-03-16  Cond 1795.00
6983    BC-2 1995-06-21  Cond  640.00
7833    BC-3 1994-01-20  Cond  406.00
7838    BC-3 1994-02-17  Cond  401.00
7847    BC-3 1994-03-24  Cond  441.00
7854    BC-3 1994-06-13  Cond  400.00
7866    BC-3 1994-07-25  Cond  393.00
7871    BC-3 1994-08-18  Cond  420.00
7877    BC-3 1994-10-20  Cond  438.00

   Perhaps because it's Monday I'm not successfully writing the xyplot()
command to show the quant, for example, for TDS by site. What I need to do
is plot the quant values for TDS vs. Cond, TDS vs. SO4, etc.

   Have I incorrectly subset the data? I know that I've missed something but
cannot determine what it is.

Rich



More information about the R-help mailing list