Epidemic modeling in R