Learn R Programming

iptools (version 0.2.1)

range_boundaries: calculate the maximum and minimum IPs in an IP range

Description

when provided with a vector of IP ranges ("172.18.0.0/28"), range_boundaries calculates the maximum and minimum IP addresses in that range.

Usage

range_boundaries(ranges)

Arguments

ranges
a vector of IP ranges. Currently only IPv4 ranges work.

Value

  • a data.frame of two columns, "minimum_ip" (containing the smallest IP in the provided range) and "maximum_ip" (containing the largest). If the range was invalid, both columns will contain "Invalid" as the value.

See Also

ip_in_range to calculate if an IP address falls within a particular range, or ip_to_numeric to convert the dotted-decimal notation of returned IP addresses to their numeric representation.

Examples

Run this code
range_boundaries("172.18.0.0/28")
#  minimum_ip  maximum_ip
#1 172.18.0.0 172.18.0.15

Run the code above in your browser using DataLab