addCountryName: Add metadata to a dataframe (country name, ISO3 code, etc)

View source: R/country.R

addCountryNameR Documentation

Add metadata to a dataframe (country name, ISO3 code, etc)

Description

Add additional information (metadata) to a data frame containing country information.

Usage

addCountryName(df, ct.x = "CT", ct.y = "ACODE", ct.name = "NAME", comptype=FALSE)
addCountryISO3(df, ct.x = "CT", ct.y = "ACODE", ct.iso3 = "ISO3", comptype=FALSE)

Arguments

df

A data frame containing country information. Countries are identified by a country code, e.g. UN country code

ct.x

Country code field name in the data frame - defaults to CT

ct.y

Country code field name in the metadata data frame rcodes- defaults to ACODE

ct.name

Country name field name in the metadata data frame rcodes- defaults to NAME

ct.iso3

Country ISO3 code field name in the metadata data frame rcodes- defaults to ISO3

comptype

Wheather to include the component type (M=country or A=aggregate (country group)) - defaults to FALSE

Value

A data frame with the requested metadata added.

Author(s)

Valentin Todorov valentin.todorov@chello.at

References

UNIDO (2010), Industrial Statistics: Guidelines and Methodology.

Examples

data("graphdata")
mvax <- get.50x51()
head(addCountryName(mvax))
head(addCountryISO3(mvax))
head(addCountryISO3(mvax, comptype=TRUE))

valentint/indstat documentation built on July 2, 2023, 10:39 p.m.