Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

address_in_network

Network membership of addresses


Description

These functions check whether an address falls within a network.

is_within() performs a one-to-one matching between addresses and networks.

is_within_any() checks if each address falls within any of the networks.

Usage

is_within(address, network)

is_within_any(address, network)

Arguments

address

An ip_address vector

network

An ip_network vector

Value

A logical vector

See Also

Use is_subnet() to check if an ip_network is within another ip_network.

Examples

is_within(ip_address("192.168.2.6"), ip_network("192.168.2.0/28"))

is_within(ip_address("192.168.3.6"), ip_network("192.168.2.0/28"))

is_within_any(ip_address("192.168.3.6"), ip_network(c("192.168.2.0/28", "192.168.3.0/28")))

ipaddress

Tidy IP Addresses

v0.5.1
MIT + file LICENSE
Authors
David Hall [aut, cre] (<https://orcid.org/0000-0002-2193-0480>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.