inst/userguide/figures/MLR--Cs_027_sleep-plot.R

###################################################
### code chunk number 30: Cs_027_sleep-plot
###################################################
library(lattice)
xyplot(Reaction ~ Days | Subject, sleepstudy,
  type = c("g", "p", "r"),
  index = function(x, y) coef(lm(y ~ x))[1],
  xlab = "Days of sleep deprivation",
  ylab = "Average reaction time (ms)", aspect = "xy"
)
nwfsc-timeseries/MARSS documentation built on June 3, 2023, 1:32 p.m.