wdkrnls
wdkrnls

Reputation: 4702

Multiple smoothers or lines per group in a lattice plot

In ggplot2 the distinction between color and group is very clear to me. In lattice, it is not. For example, in the Pixel data set in the nlme package, it is easy to make a plot like this:

library(ggplot2)
library(nlme)
Pixel |> 
  ggplot(aes(day, pixel, color = Side, group = interaction(Dog, Side))) + 
  geom_point() + 
  geom_smooth(se = FALSE, method = "loess", span = 1.4, size = 0.5) + 
  geom_line(linetype = 3)

enter image description here How might I make the same plot from lattice?

Upvotes: 0

Views: 28

Answers (0)

Related Questions