gsg (gam selection gradients) provides a unified approach to the regression analysis of selection from longitudinal data collected from natural populations.