An R package for fitting age, period and cohort models