Learn R Programming

ipaddress (version 0.3.0)

network_in_network: Network membership of other networks

Description

overlaps() checks for any overlap between two networks; is_subnet() and is_supernet() check if one network is a true subnet or supernet of another network.

Usage

overlaps(network, other)

is_subnet(network, other)

is_supernet(network, other)

Arguments

network

An ip_network vector

other

An ip_network vector

Value

A logical vector

See Also

Use is_within() to check if an ip_address is within an ip_network.

Examples

Run this code
# NOT RUN {
net1 <- ip_network("192.168.1.128/30")
net2 <- ip_network("192.168.1.0/24")

overlaps(net1, net2)

is_subnet(net1, net2)

is_supernet(net1, net2)
# }

Run the code above in your browser using DataLab