rvkstat (version 3.2.0)

vkGetDbCities: City Dictionary.

Description

Returns a list of cities and countries.

Usage

vkGetDbCities(
    country_id,
    region_id    = NULL,
    q            = NULL,
    need_all     = TRUE,
    username     = getOption("rvkstat.username"),
    api_version  = getOption("rvkstat.api_version"),
    token_path   = vkTokenPath(),
    access_token = getOption("rvkstat.access_token")
)

Arguments

country_id

country identifier obtained using the vkGetDbCountries function.

region_id

identifier of the region whose city you want to receive. (this parameter is optional.

q

search query string. For example, "Saint". The maximum string length is 15 characters.

need_all

Boolean TRUE or FALSE, flag <U+2014> return a list of all countries.

username

Your vkontakte login.

api_version

Vkontakte API version.

token_path

Path to dir with credentials

access_token

API access tokens obtained using vkAuth or vkGetToken functions

Value

Date frame with community statistics with the following values:

cid

country id.

title

country name.

important

mark key cities for the current user.

area

area.

region

region.

Details

the q parameter is not specified, then a list of the largest cities in the given country will be returned. If the q parameter is specified, a list of cities that are relevant to the search query will be returned.

References

Documentation for API method database.getCities: https://vk.com/dev/database.getCities

Examples

Run this code
# NOT RUN {
## Get a list of cities for Ukraine, because Ukraine id = 2
vk_cities <- vkGetDbCities(country_id = 2)

## Get the list of cities for the search query "St."
vk_cities_search <- vkGetDbCities(country_id = 1,
                                  q = "St.")

# }

Run the code above in your browser using DataLab