Possible Duplicate:
Generate multiple graphics from within an R function
I am using this ggplot function to plot multiple variables by using a list:
plotTimeSeries <- list(n25_30,n28_30,n29_30,n31_30,n32_30)
for (i in plotTimeSeries) {
i$dt <- strptime(i$dt, "%Y-%m-%d %H:%M:%S")
ggplot(i, aes(dt, ambtemp)) + geom_line() +
scale_x_datetime(breaks = date_breaks("2 hour"),
labels=date_format("%H:%M")) +
labs(x="Time 00.00 ~ 24:00 (2007-09-30)",y="Ambient Temperature",
title = (paste("Node",i)))
}
data sample:
ambtemp dt
1 -1.64 2007-09-29 00:01:09
2 -1.76 2007-09-29 00:03:09
3 -1.83 2007-09-29 00:05:09
4 -1.86 2007-09-29 00:07:09
5 -1.94 2007-09-29 00:09:09
6 -1.87 2007-09-29 00:11:09
7 -1.87 2007-09-29 00:13:09
8 -1.80 2007-09-29 00:15:09
9 -1.64 2007-09-29 00:17:09
10 -1.60 2007-09-29 00:19:09
11 -1.90 2007-09-29 00:21:09
I do not know how should I call the function in r. Actually, no error happened by code. On the other hand no results appeared by ruining this code.