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
On Mon, 24 Oct 2011, Rich Shepard wrote:> 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.I should have provided some of the attempts: xyplot(quant ~ TDS | site, data = burns.tds.anal) Error in eval(expr, envir, enclos) : object 'TDS' not found xyplot(quant ~ 'TDS' | site, data = burns.tds.anal) Warning messages: 1: In order(as.numeric(x)) : NAs introduced by coercion 2: In diff(as.numeric(x[ord])) : NAs introduced by coercion 3: In function (x, y, type = "p", groups = NULL, pch = if (is.null(groups)) plot.symbol$pch else superpose.symbol$pch, : NAs introduced by coercion This produces a plot with no data in each panel. And I cannot see how to specify, for example, 'TDS' x 'Cond' because xyplot('TDS'$quant ~ 'Cond'$quant | site, data = burns.tds.anal) Error in "TDS"$quant : $ operator is invalid for atomic vectors and xyplot('TDS'[quant] ~ 'Cond'[quant] | site, data = burns.tds.anal) There were 25 warnings (use warnings() to see them) produces the panels without data in them. Rich
Why not format the data like this: site sampledate SO4 TDS NA Mg Cond Cl Ca i.e. with a column for each parameter? It seems to me that you summary doesn't make any sense. Those quantiles are meaningless as they encompass all the parameters. Am I missing something? Rich Shepard wrote:> > 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 > > ______________________________________________ > R-help@ 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. >-- View this message in context: http://r.789695.n4.nabble.com/Syntax-Help-for-xyplot-tp3934533p3934721.html Sent from the R help mailing list archive at Nabble.com.