Learn R Programming

bayesTFR (version 1.2-0)

get.country.object: Accessing Country Information

Description

The function returns an object containing country name, code and index.

Usage

get.country.object(country, meta = NULL, country.table = NULL, 
    index = FALSE)

Arguments

Value

List with components:nameCountry namecodeCountry codeindexCountry index

Rdversion

1.1

Details

Given partial information about a country (i.e. having either name or code or index), the function returns an object containing all three pieces of information. Only countries from the UN2008 dataset are considered that are included in the simulations and predictions. Note that country index is an internal index used in various components of a bayesTFR.mcmc.meta object. Thus, it does not relate to the column Index in UN2008.

See Also

country.names, UN2008

Examples

Run this code
sim.dir <- file.path(.find.package("bayesTFR"), "ex-data", 'bayesTFR.output')
m <- get.tfr.mcmc(sim.dir)
# all three 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)

Run the code above in your browser using DataLab