title: Fitting smooth through xyplot
body: <p>This question seems simple but I haven't been able to figure out how to do it. I'm trying to fit a smooth line through longitudinal dataset as illustrated in the following code</p>
  
  <pre><code>library(nlme)
  xyplot(conc ~ Time, data = Theoph, groups = Subject, type = c("l", "smooth"))
  </code></pre>
  
  <p>The output isn't quite what I'm after and there are multiple warnings. I would like to fit a smooth through the entire data.   As a bonus, if anyone could also show how to do this using ggplot, that would be great. </p>