pop.predict(end.year = 2100, start.year = 1950, present.year = 2010,
wpp.year = 2010, countries = NULL,
output.dir = file.path(getwd(), "bayesPop.output"),
inputs = list(popM=NULL, popF=NULL, mxM=NULL, mxF=NULL, srb=NULL,
pasfr=NULL, mig.type=NULL, migM=NULL, migF=NULL,
e0F.file=NULL, e0M.file=NULL, tfr.file=NULL,
e0F.sim.dir=NULL, e0M.sim.dir=NULL, tfr.sim.dir=NULL),
nr.traj = 1000, replace.output = FALSE, verbose = TRUE)NULL, all available countries are used. If it is NA and there is an existing projection in output.dir and replace.output=FALoutput.dir and replace.output=TRUE, everything in the directory will be deleted.NULL are shown in brackets):
[object Object],[object Object],[object Object],[obe0M.file/e0M.sim.dir, e0F.file/e0F.sim.dir and tfr.file/tfr.sim.dir contains less trajectories than nr.traj, the number is set to the TRUE, everything in the directory output.dir is deleted prior to the prediction.bayesPop.prediction with the following elements:quantiles.traj.mean.sd corresponding to male and female projection, respectively.quantiles.quantilesMage.code, name.e0M.sim.dir, e0F.sim.dir, tfr.sim.dir of the inputs argument), or they can be given as ASCII tables in csv format, see above.The projection is generated sequentially country by country. Results are stored in a sub-directory of output.dir called totp, totpf, totpm (trajectories of total population, female and male, respectively), totp.hch, totpf.hch, totpm.hch (the UN half-child variant for total population, female and male, respectively). Furthermore, an object of class bayesPop.prediction is stored in the same directory in a file
To access a previously stored prediction object, use get.pop.prediction.
pop.trajectories.plot, pop.pyramid, get.pop.predictionsim.dir <- tempfile()
# Countries can be given as a combination of numerical codes and names
pred <- pop.predict(countries=c("Netherlands", 218, "Madagascar"), nr.traj=10,
output.dir=sim.dir)
pop.trajectories.plot(pred, "Ecuador", sum.over.ages=TRUE)
unlink(sim.dir)Run the code above in your browser using DataLab