Description Usage Arguments Details See Also Examples
Plot a comparison between the simulated population and real population age profiles, separately for females and males.
The function looks in the specified folder for 2 tab-separated files containing age-specific counts from the real female and male population.
1 2 |
x |
an object returned by the |
option |
simulated population source. 2 possible values "base" and "current" (see Details). The default is "current". |
population.fem |
name (quoted) of the tab-separated file containing age-specific counts from the real female population (e.g. "populationfem.txt"). |
population.male |
name (quoted) of the tab-separated file containing age-specific counts from the real male population (e.g. "populationmale.txt") |
year |
the year for which to plot the comparison |
folder |
folder (quoted) where the function looks for the real population files. For example, it might be R_HOME/library/poplab/extdata/ directory, where R_HOME is the location where R is installed on your computer (see Examples below). |
... |
further arguments used e.g., other plot options |
option
specifies which simulated population to be displayed:
"base" requires a virtual baseline population (an object returned by the
create.baseline.complete
function or the first list
component returned by the simped
function).
"current" requires the population alive during the year specified by
year
; this is the second component of the list returned by the
simped
function.
create.baseline.complete
, simped
,
print.poplab
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## Not run:
For the following examples it is necessary to load the simpop object or to use
the simped function and assign the result to a variable called 'simpop'.
## End(Not run)
## load simulate the population for the calendar period 1954-2007:
load (file = file.path(system.file("extdata", package = "poplab"),
"simpop.Rdata"))
## plot the simulated population versus the real population
## for the calendar year 1990:
plot.poplab(x = simpop, option = "current", population.fem = "populationfem.txt",
population.male = "populationmale.txt", year = 1990, folder =
system.file("extdata", package = "poplab"))
## plot the baseline population versus the real population
## for the calendar year 1954:
plot.poplab(x = simpop, option = "base", population.fem = "populationfem.txt",
population.male = "populationmale.txt", year = 1954, folder =
system.file("extdata", package = "poplab"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.