# NOT RUN {
plot(cars$speed, cars$dist, pch=16, col=alpha(1))
lm1 <- lm(dist ~ speed, dat=cars)
abline(lm1, col='red', lwd=2)
rug_model(lm1, view='speed')
rug_model(lm1, view='dist', side=2)
# }
# NOT RUN {
library(itsadug)
data(simdat)
m1 <- bam(Y ~ Group + te(Time, Trial, by=Group), data=simdat)
# plot:
fvisgam(m1, view=c('Time', 'Trial'), cond=list(Group='Adults'))
rug_model(m1, view='Time', cond=list(Group='Adults'))
rug_model(m1, view='Trial', cond=list(Group='Adults'), side=2)
# }
Run the code above in your browser using DataLab