Skip to contents

Given a vector of networks, this returns the minimal set of networks required to represent the same range of addresses.

Usage

collapse_networks(network)

Arguments

network

An ip_network vector

Value

An ip_network vector (potentially shorter than the input)

Examples

collapse_networks(ip_network(c("192.168.0.0/24", "192.168.1.0/24")))
#> <ip_network[1]>
#> [1] 192.168.0.0/23