R: Return CIDR ranges for given ISO 3166-1 alpha-2 country codes

country_ranges {iptools} | R Documentation

## Return CIDR ranges for given ISO 3166-1 alpha-2 country codes

### Description

Query http://www.iwik.org/ipcountry/ for the CIDR ranges for a given set of ISO 3166-1 alpha-2 country codes and return the results in a named list of character vectors.

### Usage

    country_ranges(countries)

### Arguments

`countries` | character vector of ISO 3166-1 alpha-2 country codes (case-insensitive)

### Details

An internal cache of the CIDR query results are maintained as they only change daily (12:00 CET). The cache can be flushed with `flush_country_cidrs` and which codes have been cached can be retrieved with `cached_country_cidrs)`.

### Value

named list of character vectors of CIDR blocks

### Note

This function requires internet connectivity as it pulls daily updated data from http://www.iwik.org/ipcountry/.

### Examples

    rng <- country_ranges(c("PW", "UZ"))

[Package iptools version 0.6.1 Index]