country_networks {ipaddress}R Documentation

Country-level IP networks

Description

Retrieve lists of IP networks registered to specific countries.

Usage

country_networks(country, ..., collapse = TRUE)

Arguments

country

Character vector of two-letter country codes (ISO 3166-1 alpha-2)

...

These dots are for future extensions and must be empty.

collapse

If TRUE (the default), contiguous networks are collapsed. See collapse_networks().

Details

This function requires an internet connection to download network lists.

Value

A data frame with 2 variables:

Each row represents a single country associated with a vector of IP networks.

Source

https://www.iwik.org/ipcountry/ (updated daily)

Examples

## Not run: 
country_networks(c("GB", "US"))

country_networks(c("GB", "US"), collapse = FALSE)

# retrieve networks for a single country
country_networks("TO")$networks[[1]]

# expand networks for multiple countries
tidyr::unchop(country_networks(c("GB", "US")), networks)

## End(Not run)

[Package ipaddress version 1.0.2 Index]