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 |
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 ofip_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)
[Package ipaddress version 1.0.2 Index]