title: Syntax error in ggplot Function in R
body: <p>I wanted to create automatic plot function by using following code:</p>
  
  <pre><code>plotTimeSeries &lt;- list(temp1,temp2)
  
  lapply(1:length(plotTimeSeries) , function(i) 
  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")) + xlab("Time 00.00 ~ 24:00 (2007-09-29)") + ylab("Ambient Tempreture")+
    opts(title = ("Node i")))
  </code></pre>
  
  <p>But I faced with the error below:</p>
  
  <pre><code>Error: unexpected ')' in:
  "           scale_x_datetime(breaks = date_breaks("2 hour"),labels=date_format("%H:%M")) + xlab("Time 00.00 ~ 24:00 (2007-09-29)") + ylab("Ambient Tempreture")+
             opts(title = ("Node i")))"
  </code></pre>
  
  <p>Sample data properties:</p>
  
  <pre><code>'data.frame':   731 obs. of  2 variables:
   $ ambtemp: num  0.23 0.26 0.35 0.31 0.32 0.3 0.36 0.33 0.27 0.27 ...
   $ dt     : POSIXct, format: "2007-09-29 23:39:05" "2007-09-29 23:41:05" "2007-09-29 23:43:05" ...
  </code></pre>
  
  <p>Sample data:</p>
  
  <p>temp1:</p>
  
  <pre><code> surtemp    date_time
  1    0.23 2007-09-29 23:39:05
  2    0.26 2007-09-29 23:41:05
  3    0.35 2007-09-29 23:43:05
  4    0.31 2007-09-29 23:45:05
  5    0.32 2007-09-29 23:47:05
  6    0.30 2007-09-29 23:49:05
  </code></pre>
  
  <p>temp2:</p>
  
  <pre><code>     surtemp    date_time
  1   -1.42 2007-09-28 23:39:09
  2   -1.24 2007-09-28 23:41:09
  3   -1.28 2007-09-28 23:43:09
  4   -1.28 2007-09-28 23:45:09
  5   -1.24 2007-09-28 23:47:09
  6   -1.42 2007-09-28 23:49:09
  </code></pre>