country_networks: Country-level IP networks

View source: R/country_networks.R

country_networksR 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:

  • country: A character vector

  • network: A list of ip_network vectors

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)

ipaddress documentation built on April 4, 2023, 9:09 a.m.