Description Usage Arguments Details Value Author(s) See Also Examples
Function get.country.object
returns an object containing country name, code and index. Functions get.countries.table
return a data frame containing codes and names of all countries.
1 2 3 4 5 | get.country.object(country, meta = NULL, country.table = NULL, index = FALSE)
## S3 method for class 'bayesTFR.mcmc.set'
get.countries.table(object, ...)
## S3 method for class 'bayesTFR.prediction'
get.countries.table(object, ...)
|
country |
Country name, code or index. If it is an index, the argument |
meta |
Object of class |
country.table |
A table containing columns “name” and “code” from which the country info can be extracted. Only relevant, if |
index |
Logical determining if the argument |
object |
Object of class |
... |
Not used. |
Given partial information about a country (i.e. having either name or code or index), the function get.country.object
returns an object containing all three pieces of information. Only countries are considered that are included in the simulations and predictions. Country index is an internal index used in various components of a bayesTFR.mcmc.meta
object.
Function get.country.object
returns a list with components:
name |
Country name |
code |
Country code |
index |
Country index |
Function get.countries.table
return a data frame with columns code
and name
.
Hana Sevcikova
1 2 3 4 5 6 7 | sim.dir <- file.path(find.package("bayesTFR"), "ex-data", "bayesTFR.output")
m <- get.tfr.mcmc(sim.dir)
# all four calls should give the same answer
get.country.object('China', m$meta)
get.country.object(156, m$meta)
get.country.object(56, m$meta, index=TRUE)
get.country.object(156, NULL, country.table=get.countries.table(m))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.