Modelling stage-structured populations in R