Compare-methods: Methods for IP Comparison

ComparisonR Documentation

Methods for IP Comparison

Description

Methods for IP binary comparison

Value

a logical vector

Methods

x == y
x != y
x > y
x < y
x >= y
x <= y

Note

Arguments must be objects of either class 'IPv4', 'IPv6' or 'IP'. Comparisons are vectorized using the SIMD AVX2 instructions set if IP the package was compiled with the "--enable-avx2" flag.

Examples

  ##
  ip1 <- ip(c("192.0.0.1", "fd00::1")) + rep(c(0:2),each=2)
  ##
  ip2 <- ip1 + rep(c(1,-1,0), each=2)
  ##
  data.frame(
    ip1, ip2
    , lt = ip1<ip2
    , le = ip1<=ip2
    , eq = ip1==ip2
    , ge = ip1>=ip2
    , gt = ip1>ip2
  )

IP documentation built on Sept. 2, 2026, 5:09 p.m.