Skip to content
Prev 155354 / 398506 Next

plot a list

I have one more question.  The below example is revised to better
reflect the problem that I am running into.  The two columns for each
data frame in the list are named the same because they are subsets of
the same site, which has the same name in the larger data set.  So
when xyplot plots the merged list it labels each plot with a
structure(...) see the plot in the example below.  I need to have the
labels from each column (Temp and DO) show up on each one of there
corresponding plots.  I am using this to scan the data for "bad"
dissovled oxygen signals so that I can throw out erroneous readings
before the calculation of Primary Productivity.  Thanks in advance.
If this is not clear I will try and explain better.

#here is a made up example
library(chron)
library(zoo)
t1 <- chron("1/1/2006", "00:01:00")
t2 <- chron("1/1/2006", "23:46:00")
deltat <- times("00:15:00")
tt <- seq(t1, t2, by = times("00:15:00"))
DO <- rnorm(96)
Temp <- rnorm(96)
a <- cbind(Temp, DO)


t3 <- chron("12/1/2006", "00:01:00")
t4 <- chron("12/1/2006", "23:46:00")
deltat <- times("00:15:00")
tt.2 <- seq(t3, t4, by = times("00:15:00"))
DO <- rnorm(96)
Temp<- rnorm(96)
b <- cbind(Temp, DO)

t5 <- chron("5/1/2006", "00:01:00")
t6 <- chron("6/1/2006", "23:46:00")
deltat <- times("00:15:00")
tt.3 <- seq(t5, t6, by = times("00:15:00"))
DO <- rnorm(96)
Temp<- rnorm(96)
g <- cbind(Temp, DO)

z1 <- zoo(a, tt)
z2 <- zoo(b, tt.2)
z3 <- zoo(g, tt.3)

z.l <- list(z1,z2,z3)

zm <- do.call(merge, z.l)
xlim <- lapply(zm, function(x) range(time(na.omit(x))))
xyplot(zm, xlim = xlim, scale = list(relation = "free"))

On Sat, Sep 6, 2008 at 9:17 PM, Gabor Grothendieck
<ggrothendieck at gmail.com> wrote: