Skip to content
Prev 275425 / 398506 Next

Syntax Help for xyplot()

The following might not be exactly the way to do this, but see the package
"reshape" and the line of code following your data:


df <- structure(list(site = structure(c(1L, 1L, 2L, 4L, 2L, 2L, 2L, 
3L, 3L, 3L, 3L, 3L, 3L, 3L), .Label = c("BC-0.5", "BC-2", "BC-3", 
"BC-4"), class = "factor"), sampdate = structure(c(11L, 11L, 
5L, 12L, 7L, 9L, 10L, 1L, 2L, 3L, 4L, 5L, 6L, 8L), .Label = c("1994-01-20", 
"1994-02-17", "1994-03-24", "1994-06-13", "1994-07-25", "1994-08-18", 
"1994-10-19", "1994-10-20", "1995-03-16", "1995-06-21", "1996-06-02", 
"1996-08-23"), class = "factor"), param = structure(c(2L, 3L, 
1L, 2L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L, 1L), .Label = c("Cond", 
"SO4", "TDS"), class = "factor"), quant = c(194, 530, 826, 36, 
848, 1795, 640, 406, 401, 441, 400, 393, 420, 438)), .Names = c("site", 
"sampdate", "param", "quant"), class = "data.frame", row.names = c("82", 
"83", "6903", "6905", "6977", "6980", "6983", "7833", "7838", 
"7847", "7854", "7866", "7871", "7877"))

library(reshape)
Using site, sampdate, param as id variables
     site   sampdate Cond SO4 TDS
1  BC-0.5 1996-06-02   NA 194 530
2    BC-2 1994-07-25  826  NA  NA
3    BC-2 1994-10-19  848  NA  NA
4    BC-2 1995-03-16 1795  NA  NA
5    BC-2 1995-06-21  640  NA  NA
6    BC-3 1994-01-20  406  NA  NA
7    BC-3 1994-02-17  401  NA  NA
8    BC-3 1994-03-24  441  NA  NA
9    BC-3 1994-06-13  400  NA  NA
10   BC-3 1994-07-25  393  NA  NA
11   BC-3 1994-08-18  420  NA  NA
12   BC-3 1994-10-20  438  NA  NA
13   BC-4 1996-08-23   NA  36  NA
Rich Shepard wrote:
--
View this message in context: http://r.789695.n4.nabble.com/Syntax-Help-for-xyplot-tp3934533p3934857.html
Sent from the R help mailing list archive at Nabble.com.