match_country_name: Match_country_name

Description Usage Arguments Value Examples

View source: R/countries_lib.R

Description

Add countries names to database

Usage

1
match_country_name(posnames, realnames, priorities = "2")

Arguments

posnames

Character vector of possible countries names.

realnames

Character vector of official(common) countries names.

priorities

Character vector of priorities. Takes values "1" or "2". Priorities should have same length with posnames, otherwise will be initialized priorities vector with length of posnames and value "2".

Value

Unit character vector "Success" if matching was correct, or unit vector "Invalid arguments" if types of arguments aren't correct (for example, zero length names in argument posnames or diffrent length of posnames and realnames).

Examples

1
2
3
4
5
6
match_country_name("Rassiya", "Russia")
vect_1 <- c("ru", "en", "usa") # posnames
vetc_2 <- c("Russia", "United Kingdom", "United States") #realnames
match_country_name(vect_1, vect_2)
vect_3 <- c("1", "2", "1") # priorities
match_country_name(vect_1, vect_2, vect_3)

AlekseyPauls/countriesLibR documentation built on May 21, 2019, 7:53 a.m.