ip_to_subnet | R Documentation |
Given a character vector of IP addresses in CIDR notation (e.g. 1.2.3.4/24
)
or a character vector of IP addresses and an integer vector of prefix lengths,
return a character vector of the network (in CIDR notation).
ip_to_subnet(ip_addresses, prefix_lengths = NULL)
ip_addresses |
either a character vector of IP addresses in CIDR notation
(e.g. |
prefix_lengths |
should be |
Suggested by Slava Nikitin (https://github.com/hrbrmstr/iptools/issues/38).
host_ip <- c("1.2.3.4", "4.3.2.1") subnet_len <- c(24L, 25L) ip_to_subnet(host_ip, subnet_len) ip_to_subnet(c("1.2.3.4/24", "4.3.2.1/25"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.